Menu

Expand
Rate this page:

App Installation and Setup

How to get the app

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.

Twilio for Salesforce prerequisites

  • 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 from the AppExchange

Install Twilio for Salesforce using the links available on this page. When prompted, select Install for All Users:

Salesforce installation dialog

Once the package has finished installing, search for Twilio Configuration from the Salesforce App Launcher. You should then see this page:

Get Twilio Configuration from the Salesforce App Launcher

Obtain your Twilio Account SID and Auth Token

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:

Twilio Account Dashboard

Paste your Twilio Account SID and Auth Token into Salesforce, then click on Validate Credentials:

Twilio Config connect panel

You should see a confirmation message like this:

Your credentials are confirmed

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.

Create a Messaging Service

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:

Create new messaging service

Give your Messaging Service a name that makes sense for your project. For example, Twilio for Salesforce: Production.

Create a new Messaging Service

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.

Add phone numbers to your Messaging Service

Next, we’ll add a phone number to your Messaging Service. In the sidebar, click on Numbers then Buy a Number:

Buy a phone number

Use the phone numbers interface to search for a number and then click on Buy to purchase it:

Select a phone number to buy

Once you’ve purchased your first phone number, you should see it appear in your Messaging Service:

Your phone number 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.

Receive incoming messages in Salesforce: create a webhook for your Messaging Service

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 Failed 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:

Select TwiML Bins from the navbar

Then, click on Create new TwiML Bin:

Create a TwiML Bin

Inside your new TwiML Bin, add the following TwiML snippet:

<Response></Response>

Once your TwiML Bin should looks like this, click Save.

Next, copy your TwiML Bin’s URL:

Copy the TwiML Bin 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:

Setting up webhook to receive messages in Salesforce

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.

Select your Messaging Service in Salesforce

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:

Connect to Salesforce and validate

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:

Options on the Twilio Configuration page

Add Lightning components to Salesforce layouts

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:

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.

Add users to the Twilio permission sets

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:

Find your permission set options

On the Permission Set page, click on Manage Assignments:

Start to set users&#x27; permissions

Then, click on the user you would like to assign to the permission set:

Select a user

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.

Production only: add users to licenses

In production instances of Salesforce, you’ll need to provision your users with licenses. You can do this by going to Twilio App in Salesforce -> Twilio Configuration -> Purchase License Section -> Click on Configure Licenses. 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.

Configure License.png

Click on Add Users, 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 functionality.

Add Users

Select the users you want to have access to the package

Next steps with Twilio and Salesforce

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:

Rate this page:

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.

        
        
        

        Thank you for your feedback!

        We are always striving to improve our documentation quality, and your feedback is valuable to us. Please select the reason(s) for your feedback or provide additional information about how we can improve:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more