Start your free trial of Twilio for Salesforce here. The trial package includes 30 free seats for 30 days. Twilio for Salesforce is priced at $15 per user per month.
- A Twilio account — sign up here if you don’t have one yet.
Note If you’re installing Twilio for Salesforce in multiple environments, we recommend creating separate Twilio projects for each organization.
- Access to the Twilio for Salesforce — get it on the AppExchange.
- Administrative access to a Salesforce with a supported edition: Enterprise, Unlimited, Force.com, Developer, or Performance.
- MyDomain configured for your Salesforce instance.
Twilio for Salesforce installation takes 10-20 minutes. Let’s get started.
Install Twilio for Salesforce using the links available on this page. When prompted, select Install for All Users:
Once the package has finished installing, search for
Twilio Configuration from the Salesforce App Launcher. You should then see this page:
From the Twilio Configuration page in Salesforce, click on the Create Account or Log In buttons to go to the Twilio Console. Copy the Account SID and Auth Token values from the front page of the console:
Paste your Twilio Account SID and Auth Token into Salesforce, then click on Validate Credentials:
You should see a confirmation message like this:
Next, we’ll create a messaging service — a pool of phone numbers — to be used with Twilio for Salesforce.
Tip If you need to configure Twilio with multiple Salesforce instances or environments, we recommend creating a separate Twilio Project for each instance. Each instance will have a unique Account SID and Auth Token.
A Messaging Service is a pool of Twilio phone numbers that are enabled with software to prevent text encoding issues, provide international phone numbers, and scale messaging capacity. Twilio for Salesforce uses a messaging service to provide phone numbers for three types of SMS:
- SMS sent from Salesforce users that don’t have a personal phone number assigned.
- Campaign SMS sent from the Campaigns Lightning Component.
- Notifications sent from the Send SMS process builder action.
To create a mesaging service, open the Messaging Services page in the Twilio Console. Click on Create new Messaging Service:
Give your Messaging Service a name that makes sense for your project. For example,
Twilio for Salesforce: Production.
Choose the Notifications, Two-Way use case — or choose another based on your own use case. The use case is for internal Twilio use only, and has no impact on applicaton behavior. When you’re ready, click on the red Create button to establish your new messaging service.
Next, we’ll add a phone number to your Messaging Service. In the sidebar, click on Numbers then Buy a Number:
Use the phone numbers interface to search for a number and then click on Buy to purchase it:
Once you’ve purchased your first phone number, you should see it appear in your Messaging Service:
Now that your Messaging Service is set up with a phone number, you can return to the Twilio configuration page to connect the Messaging Service to Salesforce.
Next, we need to provide instructions to tell Twilio how to handle inbound messages. This step is necessary for you to see your incoming messages inside Salesforce.
If this is not configured, your incoming messages will be marked as
Error: 30008 and will not be synced to Salesforce.
To handle inbound requests, we need to create a TwiML Bin with an empty
<Response /> TwiML verb and then add that TwiML Bin’s handler URL as our webhook. If you’re new to Twilio and this sounds unfamiliar, don’t worry: we have screenshots every step of the way.
In the navigation sidebar of the Twilio Console, click TwiML Bins:
Then, click on Create new TwiML Bin:
Inside your new TwiML Bin, add the following TwiML snippet:
Once your TwiML Bin should looks like this, click Save.
Next, copy your TwiML Bin’s URL:
Finally, you can go back to your Messaging Service and then click on Integration, check the Send a Webhook radio button, paste your TwiML Bin URL into the Request URL field, and finally click Save at the bottom of the page:
Great work! Your messaging service now has a URL to send messages to. This will stop you from getting false warnings when you receive an inbound message.
Return to the Twilio Configuration page in Salesforce and refresh the page. You should now be able to select your Messaging Service from the dropdown menu — do so then click Validate Credentials:
Once your Twilio Account SID, Auth Token, and Messaging Service have been validated, you should see the full list of configuration options appear on the Twilio Configuration page:
You can add Twilio for Salesforce’s Lightning components using Salesforce’s Lightning App Builder. Open the Lightning App Builder by opening a record (Leads, Contacts, Person Accounts, Cases, or Campaigns), clicking on the configuration gear icon, and selecting Edit Page.
You can then use the Lightning App Builder to add components to the page:
Click Save in the top-right corner of the Lightning App Builder and then follow the instructions to deploy your layout to users.
The last step before using the Twilio features in your Salesforce install is to add users.
Anyone who should have access to Twilio functionality should be divided between the two new permission sets that were added to your organization during installation: Twilio User and Twilio Administrator. A User can send and view messages, and generally access all the features of the package. An Administrator will be able to view and configure Twilio API credentials.
To add these permission sets in Salesforce, go to Setup then search for
Permission Sets in the quick find field, then click on the permission set you’d like to provision:
On the Permission Set page, click on Manage Assignments:
Then, click on the user you would like to assign to the permission set:
If you’re in a sandbox environment, you don’t need to do anything further. If you’re in a production organization, you’ll need to configure Salesforce licenses for the users that need access.
In production instances of Salesforce, you’ll need to provision your users with licenses. You can do this by going to Setup > Apps > Installed Packages > Twilio for Salesforce. The trial package includes 30 free seats for 30 days. Twilio for Salesforce is priced at $15 per seat per month with volume discounts available. Contact sales for more information about purchase and discounts.
Click on Manage Licenses, and then select the users who you would like to have access to the package. You do not need to provision every user in your organization, only those who will be using Twilio SMS:
Now that your Twilio for Salesforce install is all set, it’s time to start sending some messages.
Here are some more Twilio for Salesforce tutorials to help you make the most of your installation:
- Send automated SMS messages from Process Builder.
- Send bulk SMS messages to campaign members.
- Message contacts one on one from their Salesforce record page.