UNPKG

notification-services

Version:

use email, sms and custom notification services for node.js application easily

34 lines (33 loc) 970 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.gupshupSend = void 0; const axios_1 = __importDefault(require("axios")); const gupshupSend = (options, callback) => { const opt = { userid: options.userId, password: options.password, send_to: options.to, method: "SendMessage", msg: options.message, msg_type: "Text", auth_scheme: "Plain", v: "1.1", format: "text", mask: options.mask, }; (0, axios_1.default)({ method: "get", url: `http://enterprise.smsgupshup.com/GatewayAPI/rest`, params: opt, }) .then((response) => { callback(response, null); }) .catch((error) => { callback(null, error); }); }; exports.gupshupSend = gupshupSend;