Skip to content

Instantly share code, notes, and snippets.

@JacobKnaack
Created June 14, 2019 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobKnaack/b1376e9477ede457e8cc5f209ce1969f to your computer and use it in GitHub Desktop.
Save JacobKnaack/b1376e9477ede457e8cc5f209ce1969f to your computer and use it in GitHub Desktop.
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