Skip to content

Instantly share code, notes, and snippets.

@JacobKnaack JacobKnaack/twilioClient.js Secret
Created Jun 14, 2019

Embed
What would you like to do?
Cosmic Messenger twilio client file
var config = require('./config');
module.exports.sendSms = function (to, message) {
var client = require('twilio')(config.accountSid, config.authToken);
return client.api.messages
.create({
body: message,
to: to,
from: config.sendingNumber,
}).then(function (data) {
console.log('Administrator notified');
}).catch(function (err) {
console.error('Could not notify administrator');
console.error(err);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.