Created
March 10, 2018 21:15
-
-
Save adamjstevenson/9a60628bae2dc31ea38511058fab46d9 to your computer and use it in GitHub Desktop.
Send an SMS with Twilio
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
// 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