Sending an SMS with Twilio

In this article we will discuss how to setup Lead Prosper to send an SMS with Twilio.

At this moment, Lead Prosper does not have a native integration with Twilio, however, with a few simple steps, it is very easy to deliver your leads via SMS to your buyers.

Before you begin

  1. Create a Twilio account.
  2. Once logged in, you have to purchase a phone number if you do not have one already. Click the ... menu.

    Click on Phone Numbers

    Click on Buy a number

    Search for a phone number that matches your requirements. Ensure that the phone number has SMS capabilities

  3. If your Twilio account is in a trial, you need to verify the phone numbers that you will be testing. Click on Verified Caller IDs and then the plus sign to add your own phone number. This is needed so you can test, as accounts in free trial can only send SMS messages to verified phone numbers.

  4. Navigate to the Twilio dashboard and grab your Twilio Account SID and Twilio Auth Token (you need to click Show).

Lead Prosper setup

  1. Follow the steps to create or edit a buyer for your campaign.
  2. Create the following 3 static fields for your buyer.
    1. name: TwilioAccountSid, value: your Twilio Account SID.
    2. name: TwilioAuth, value: your Twilio Account SID and Twilio Auth Token separated by colon. Ex: ACxxx:ffxxx
    3. name: TwilioPhoneNumber, value: +1XXXX. This is the phone number you purchased, with country code.

  3. For the Real-time action, select Direct post and use the following:
    1. URL:{{TwilioAccountSid}}/Messages.json
    2. Request Method: POST
    3. Payload type: form
    4. To=YOUR_RECIPIENT&From={{TwilioPhoneNumber}}&Body=YOUR_BODY. YOUR_RECIPIENT will be the phone number where you want to send the SMS message. Has to contain the country code. YOUR_BODY will be the body of the SMS message. To enter new lines, you must use: %0a For example, Name: {{first_name}}%0aPhone: {{phone}}%0aEmail: {{email}} will render the Name, Phone and Email on 3 different lines
    5. Add a custom header. Name is Authorization, value is: Basic {{TwilioAuth||encode:base64}}
    6. Response mapping
      1. ACCEPTED
        1. condition: key equal with
        2. key: status
        3. value: queued
      2. DUPLICATED. Please note that by using Twilio, all your leads will be marked as ACCEPTED.
        1. condition: response contains
        2. key: default
        3. value: duplicate

Save and head over back to edit campaign page. From there, hit the Test buyer button at the top of the page. Generate any random data and send a test request. You should receive an SMS from your Twilio account with your phone number.

Use the exact same setup if you want to use Twilio to send an SMS via Webhooks from your campaign, instead of real-time action

Still need help? Contact Us Contact Us