Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Created March 10, 2018 21:15
Show Gist options
  • Save adamjstevenson/9a60628bae2dc31ea38511058fab46d9 to your computer and use it in GitHub Desktop.
Save adamjstevenson/9a60628bae2dc31ea38511058fab46d9 to your computer and use it in GitHub Desktop.
Send an SMS with Twilio
// Send SMS notification
function sendSMS(message){
twilioClient.messages.create({
to: process.env.MY_NUMBER,
from: process.env.TWILIO_SMS_NUMBER,
body: message
})
.then(msg => {
// Log the message from Twilio
console.log(msg);
})
.catch(err => {
console.error(err);
})
.done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment