-
-
Save JacobKnaack/b1376e9477ede457e8cc5f209ce1969f to your computer and use it in GitHub Desktop.
Cosmic Messenger twilio client file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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