Improving Your Case Management Response Time with Twilio SMS
Time to read: 3 minutes
When it comes to case management, the shorter your response time is the happier your customers will be. I recently published an article on Salesforce’s development blog, showing you how to improve your case management response time using a Twilio SMS integration.
Situation Trigger SMS alerts to Case Team Members for High Priority Cases
One of your customers has called to report a critical issue. The call center agent
creates a “high” priority case and assigns a case team to work on the issue.
Creating the case fires a trigger that notifies the assigned team member(s) via SMS. The entire team is simultaneously notified, enabling them to understand the issue and to start resolving it as quickly as possible.
Let’s dive into the code…
Prerequisites
- To begin, you’ll need an account with Twilio and a Twilio phone number (requires login).
- You’ll also need a Salesforce account where you can do the development.
- Next, you’ll need to install the Twilio Helper Library for Salesforce into your Salesforce org.
Step 1: Creating a trigger on Case Object
This trigger calls an Apex method, which has all the business logic to produce a list of case team members, and the message that needs to be communicated via SMS.
Step 2: Creating the Apex method to send SMS message
The Apex method “TwilioSMSAsync.sendSMSCaseTeamList” has the business logic
to determine when to send the SMS message. In our use case, we want to send the
SMS when the Priority of the case is ‘High’ (seen annotation 1 in Figure 1) and to
the entire assigned case team (see annotation 2 in Figure 1). The text message
is completely configurable by the Force.com developer. In the example code, we
specify the Case Number, Case Contact Name, their Account Name and a URL for the
SFDC case record in the SMS message.
Note: The method sendSMSCaseTeamList is specified as @future(callout=true) since
it asynchronously makes external calls to Twilio REST APIs when the trigger fires.
The Apex method does three things in the following order:
a) Gets the case details for creating the SMS message body
b) Gets the list of case team members associated with the case
c) Using the Twilio SMS API, sends a SMS to each of the case team member in
real-time
Summary
Now, you have a working example of sending SMS in real-time to case team
members, enabling the service support team to respond to critical customer
issues effectively. Since the Twilio REST API helper library is written natively in
Force.com, it’s easy to integrate with other Salesforce Objects or Case Management
applications like ServiceMax.
In future posts, we’ll show you how to extend this further so your case team
members can respond to the SMS message, essentially, creating a bi-directional SMS
messaging system.
Twilio provides the tools to solve a wide range of communications needs. For
instance, with Twilio’s Force.com helper library, we can implement:
- Click to call: Easily integrate Click2Call within Site.com or any website
- Conferencing: Enable Conference calling within Salesforce
- Interactive Voice Response (IVR) System: Build context aware IVR systems based on Salesforce data.
Find out more about Twilio solutions here
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.