Created
March 26, 2020 02:15
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
// Text message reminder set up | |
client.messages | |
.create({ | |
from: process.env.SENDER_NUMBER, | |
body: "Don't forget to feed me!", | |
to: process.env.RECIPIENT_NUMBER | |
}) | |
.then(message => { | |
context.log("Message sent"); | |
context.res = { | |
// status: 200, /* Defaults to 200 */ | |
body: "Text successfully sent" | |
}; | |
context.log("JavaScript timer trigger function ran!", timeStamp); | |
context.done(); | |
}) | |
.catch(err => { | |
context.log.error("Twilio Error: " + err.message + " -- " + err.code); | |
context.res = { | |
status: 500, | |
body: `Twilio Error Message: ${err.message}\nTwilio Error code: ${err.code}` | |
}; | |
context.done(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment