2
votes

I want to write a Twilio function in node.js that can be reused by multiple phone numbers in my Twilio account. In this function I need to obtain the inbound (called or messaged) Twilio number that triggered the function.

For example, if my function forwards an SMS to email, I need not only event.From and event.Body, I also need the "To" number. But event.to is undefined and it appears to be intended for another purpose.

I could also use the friendlyName configured for this number.

How do I obtain either of these values in a Twilio function?

1

1 Answers

2
votes

Twilio developer evangelist here. I think what you want to get the Twilio phone number that is texted is event.To with a capital T.

Hope this helps, and let me know if it does!