UNPKG

notification-services

Version:

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

18 lines (17 loc) 551 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.twilioSend = void 0; const twilioSend = (options, callback) => { const { twilioAccountSid, twilioAuthToken, message, from, to } = options; const client = require('twilio')(twilioAccountSid, twilioAuthToken); client.messages.create({ body: message, from: from, to: to }).then((response) => { callback(response, null); }).catch((error) => { callback(null, error); }); }; exports.twilioSend = twilioSend;