Twilio Conversations for Salesforce
Time to read: 3 minutes
Twilio Conversations is the backbone of text-based communication across Twilio Frontline and Twilio Flex. While both of these products provide a user interface for managers to view agent conversations, it's valuable to extend this visibility to other employees in many cases.
Twilio’s Solution Engineering Organization has created a lightweight Salesforce Lightning Component that allows Salesforce users to view the conversations between your customers and agents – with proper security controls, of course – directly from the Salesforce Contact record.
In this article, we will walk you through how to install and configure this package, as well as how to customize it for your organization’s needs.
Getting started
Twilio Conversations for Salesforce is an open source project and an unmanaged Salesforce AppExchange app. It's ready to be used out of the box but also allows you to customize as much as you'd like.
You can find the source code to the app in this Github repository.
Prerequisites
To get started you will need:
- Salesforce Developer or Sandbox with System Administrator access
- Salesforce SFDX CLI installed on your local machine
- A Twilio account - sign up for a free developer account here
Furthermore, this application is designed to work with Twilio Frontline out of the box. If you have not implemented Frontline, you can find tutorials and quickstarts here: Get started with Twilio Frontline
Step 1: Log in to your Salesforce Environment
Log into your Salesforce environment by visiting https://login.salesforce.com/
Step 2: Copy and paste this link into your browser
Copy the next line and paste it into a browser tab:
Step 3: Install the Package
Choose the installation option that makes sense for your use-case. Install for All Users is best for testing.
Check the Yes, grant access to these third-party web sites option and then hit Continue:
Step 4: Create a Twilio API Key
Log into the Twilio Console, then click the Account menu. Navigate to API keys & tokens.
On the next page, click the Create API key button and create a key by filling out the fields. Save the credentials – we’ll use them in the next step.
Step 5: Add Twilio Credentials to your Salesforce environment
Log into your Salesforce environment and create a new Twilio Account record using the API key. Go to Twilio Accounts:
You’ll want to enter a Twilio Account name, your Account SID, plus the API Key SID and secret from the key you created in the previous step.
Step 6: Add the Lightning component to the Contact Record page layout
Scroll down to the bottom of the lightning widgets then drag and drop the Conversations widget onto the page.
Excellent! And with that, you’re now ready to test the integration.
Test it out
Now, let’s test to make sure everything is working properly.
Step 1: Create a test Salesforce contact with your phone number
The component references the MobilePhone field on the Contact record. Essentially, it queries Twilio Conversations for a list of every conversation associated with that phone number.
By creating a contact with your mobile phone number, we will be able to see all of the conversations you have had with a Frontline user.
Step 2: Log into Frontline
Log into your Frontline account using either the Frontline mobile app or the web user interface (https://frontline.twilio.com/login)
Step 3: Start a Conversation with the Test Contact
Navigate to the Contact List page in Frontline, select your test contact, and send a message.
Step 4: Refresh the Salesforce Contact Record
Go back to the Salesforce Contact Record page, refresh the page, and you should see the conversation!
Integrating Twilio Frontline and Conversations with Salesforce
And with that, you have a Salesforce integration which lets you quickly view conversations inside Twilio Frontline. We can’t wait to see how you use it!
Supporting Assets/ Documentation/ Links
Phil Bredeson is a Solutions Architect at Twilio.
Al Kiramoto is a Solutions Architect at Twilio. He lives in Dallas - TX and enjoys working with customers and solving business problems - besides a good barbecue and TexMex food. He can be reached at akiramoto [at] twilio.com
Natalie Huynh is a Solutions Engineer at Twilio. She is always looking for new ways to improve the customer experience through digital communication. She can be reached at nhuynh [at] twilio.com
Related Posts
Related Resources
Twilio Docs
From APIs to SDKs to sample apps
API reference documentation, SDKs, helper libraries, quickstarts, and tutorials for your language and platform.
Resource Center
The latest ebooks, industry reports, and webinars
Learn from customer engagement experts to improve your own communication.
Ahoy
Twilio's developer community hub
Best practices, code samples, and inspiration to build communications and digital engagement experiences.