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
- Create a Twilio account.
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
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.
Navigate to the Twilio dashboard and grab your Twilio Account SID and Twilio Auth Token (you need to click Show).
Lead Prosper setup
- Follow the steps to create or edit a buyer for your campaign.
- Create the following 3 static fields for your buyer.
- name: TwilioAccountSid, value: your Twilio Account SID.
- name: TwilioAuth, value: your Twilio Account SID and Twilio Auth Token separated by colon. Ex: ACxxx:ffxxx
name: TwilioPhoneNumber, value: +1XXXX. This is the phone number you purchased, with country code.
- For the Real-time action, select Direct post and use the following:
- URL: https://api.twilio.com/2010-04-01/Accounts/{{TwilioAccountSid}}/Messages.json
- Request Method: POST
- Payload type: form
- 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
- Add a custom header. Name is Authorization, value is: Basic {{TwilioAuth||encode:base64}}
- Response mapping
- ACCEPTED
- condition: key equal with
- key: status
- value: queued
- DUPLICATED. Please note that by using Twilio, all your leads will be marked as ACCEPTED.
- condition: response contains
- key: default
- value: duplicate
- ACCEPTED
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