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