Created
September 1, 2017 17:49
-
-
Save devinrader/3493c1e0893ece0347587f6500923fea to your computer and use it in GitHub Desktop.
Forward Message to Wireless
This file contains hidden or 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
exports.handler = function(context, event, callback) { | |
console.log("From: " + event.From); | |
console.log("Body: " + event.Body); | |
let twiml = new Twilio.twiml.MessagingResponse(); | |
//No point in doing this yet since we can't send media | |
//const message = twiml.message({to:'sim:[YOUR_SIM_SID]', from:event.From}); | |
//message.body(event.Body); | |
//message.media('https://demo.twilio.com/owl.png'); | |
//Messages longer than 160 chars appear to be geting truncated to 160 | |
twiml.message({to:'sim:[YOUR_SIM_SID]', from:event.From}, event.Body); | |
callback(null, twiml); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment