Search code examples
automationtwiliosms

How to receive sms sent to a Twilio bought number to my personal number


I am new to Twilio and I am using it to send sms to leads.

Sometimes, some leads may reply to those SMS and I would to do 2 things

  1. Receive those SMS replies to my personal number.

  2. A way to reply to those SMS from my personal number but it should show the lead that the SMS is coming from the Twilio number first used to send the SMS to the lead

Is there a way to do that? Thanks


Solution

  • You can receive the SMS on your Twilio Phone Number and forward it to your personal phone number in a couple of ways. Let's say you have one Twilio Phone Number that you're using to receive the SMS, and also to forward to SMS to you.

    In that case, you can configure a TwiML Bin to forward the SMS body and the sender phone number to your phone number.

    <?xml version="1.0" encoding="UTF-8"?>
    <Response>
      <Message to="[YOUR_PERSONAL_PHONE_NUMBER]">
        {{From}}: {{Body}}
      </Message>
    </Response>
    

    The TwiML Bin would look something like the TwiML above, but you have to replace [YOUR_PERSONAL_PHONE_NUMBER] with your actual personal phone number.

    The result would be that you receive SMS saying "+1234567890: Ahoy!".

    For detailed instructions, follow this tutorial on creating an inbound Phone Proxy without any code using TwiML Bins.


    TwiML Bins are logicless, so you can't make more complex solutions with them, but you can using TwiML Studio, Twilio Functions, or your own custom solution using the programming language of your choice.

    Here's a tutorial to create a Twilio Function that can forward calls and SMS, not just inbound, but both ways.

    The UX on both these solutions aren't the best for you, but does get the job done.


    Twilio Conversations is another product that could be interesting to build your solution with, but for this you'd need multiple Twilio Phone Numbers, or to programatically buy a Twilio Phone Number as you get SMS from new senders. It allows you to respond to the Twilio Phone Number, and it'll be sent to the original sender, however you never see their actual phone number, just the Twilio Phone Number that's proxying it.