Twilio For Salesforce wonderfully intertwines the organizational capabilities of using Salesforce’s CRM platform with the communication APIs of Twilio out-of-the-box. Key features such as real-time 1:1 chat, a bulk messaging service, and compatibility with both Classic and Lightning are some of the ways the tool is instantly very useful in improving the customer experience and creating more conversational messaging.

However, as a developer, it only scratches the surface of what functionalities, from customer relationship management to workflow optimization, are possible for organizations with this tool. Salesforce Flows provide a low code method for achieving powerful custom behavior. If you’re new to flows, Salesforce provides a primer on Trailhead. Below are two simple ways Flows can help extend Twilio For Salesforce through creating notifications for your users about incoming messages and inbound SMS messages on a business or personal phone.

Starting a Salesforce Flow

Above is the configuration for a Record-Triggered Flow in Salesforce. A Record-Triggered Flow is an automated workflow that’s kicked off as a result of an object being created, updated, created or updated, or deleted. An object in Salesforce represents a database table in Salesforce that contains a specific set of information.

In this case, I’ve configured a Flow to launch when a Twilio Message object is created. Twilio Message is a custom object that is installed with the  Twilio For Salesforce managed package. Each record in the Twilio Message object represents an SMS message that is either sent into or out of the Salesforce console.

I’ve also added a conditional statement to the Record-Triggered Flow that checks the direction of the message. The Flow will only kick off if the message is an inbound message. In this case, the Flow is automatically launched when an inbound Twilio Function Message record is created in the Salesforce console. The Flows below both are set up with this baseline configuration.

 

1. SMS Message

In this example, the Flow is configured to send static outbound messages, “Hello, there is a new message in Salesforce,” to a preset mobile phone number. While this is not highly customized, this is a quick way to give users incoming templated messages that alert them to check the Salesforce console.

While this example is simple and uses hard-coded values, this concept can be developed upon. For example, by adding dynamic elements to the flow, you could query for a specific queue and send all the group members a message. One example of this would be a specific group responsible for urgent case escalations.

Another example of dynamic elements would be querying additional information, to have dynamic paths depending on what’s returned. For example, you could return a different automated message back depending on if the From number matches an existing Contact in Salesforce. The message itself could be dynamic as well, such as including a Contacts’ first name in the text for more personalized services.

 

2. In-App Push Notification

An Example Salesforce Flow

This process requires a little bit more customization and effort but provides a useful extension as well. It requires creating a Custom Notification first, which is very simple. Custom Notifications are located in their own tab in the Salesforce’s Setup browser window.

In this Flow, we are creating in-app notifications within Salesforce rather than using SMS messages as a notification. This setup is similar to the SMS message flow in the first scenario. It will only launch when an inbound SMS Message is received in Salesforce, by using a Record-Triggered Flow on the Twilio Message object with a conditional statement. However, in this example, the flow is making some additional queries. Specifically, it queries for a user(s) to assign this notification to. I’ve also added an email notification to make sure that a user has access to the notification if they are not logged into the console.

After the flow runs, a user will see a notification waiting for them in the top right corner of their Salesforce home page when they log in.

When they click the notification, they will see details about the notification, and selecting it will route them to the message body.

Taking Salesforce Flows Further

Both of these processes can be further improved for usability. For example, if your Salesforce users frequently have ad-hoc conversations with your customer base through the 2-way chat widget that is one of the pre-built native features that comes out of the box with Twilio For Salesforce, you can create a buffer so they only receive text or in-app notifications after a certain amount of time has passed. This will prevent needless notifications to your Salesforce users for situations where someone has already responded to the initial notification.

Vision Point Systems specializes in analyzing customer workflows and how to best customize Twilio for Salesforce to meet those needs. Our experience developing low code applications equips us to come up with creative solutions and get the most out of platforms. To learn more about how this could be done for your organization, set up a meeting with someone on our team to discuss.

Author