Skip to main content

Examine an Integration Use Case

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe the challenge of keeping opportunities in Salesforce in sync with text messages in Twilio.
  • Explain a MuleSoft Composer solution to sync opportunities in Salesforce with text messages in Twilio.
  • Prepare to create a flow.

Before You Start

This module builds on MuleSoft Composer Installation and Configuration, so make sure you've completed it before you continue. Recall from that module, you need to have the MuleSoft Composer User permission set if you want to build and run integration flows. 

In this module, we assume you’re an authorized MuleSoft Composer user. If you’re not a MuleSoft Composer user, that’s OK. Read along to learn how they perform the steps. Don’t try to follow the steps in a Trailhead Playground, because MuleSoft Composer isn't available in the Trailhead Playground.

Note

To learn about MuleSoft Composer’s integration features, flow components, and flow creation tasks, take MuleSoft Composer Basics.

In this unit, you step into the role of admin for Northern Trail Outfitters (NTO), an outdoor and recreational gear retailer. First, you examine an integration challenge faced by NTO, and then you learn about a MuleSoft Composer integration solution. Finally, you learn how to prepare to create your flow.

Integration Challenge

Let’s take a look at an integration challenge NTO is facing. Your sales team at NTO uses Sales Cloud to manage and maintain sales opportunities. Every opportunity goes through a series of stages in the sales process, from prospecting to proposal/price quote to closed won or lost. The sales team also uses Twilio to send text messages to associated sales managers.

Currently, the sales team is performing these tasks manually. Every time an opportunity is successfully closed, a sales rep first marks the opportunity as closed won in Salesforce. Then the sales rep sends a text message about the event to the associated sales manager. This process is time-consuming and highly error-prone, so the team wants to automate it.

Integration Solution

As a solution, you need to automate the data sync between the NTO org’s Sales Cloud and Twilio in order to achieve near real-time integration. To do this, you use MuleSoft Composer to create an integration flow that automatically syncs opportunities in Sales Cloud with text messages in Twilio. Specifically, the flow must perform the following tasks.

  1. Find any new or updated opportunity in Sales Cloud.
  2. Determine if the opportunity is marked as closed won.
  3. If it is, send a text message about the event to the associated sales manager’s phone from the sales team’s Twilio phone in Twilio.

To implement the solution using MuleSoft Composer, you need to perform these flow creation tasks.

  • Prepare to create a flow.
  • Design and test a flow.
  • Activate a flow.
  • Monitor and troubleshoot a flow.

You learn how to perform these tasks in the rest of this module.

Prepare to Create a Flow

Ready to get started?

First, you need to gather all required information about the systems and assets your flow is going to use. The following table describes the systems the flow needs to connect to and the information you need to have for those systems.

As a best practice, ensure the NTO org has a sandbox org you can connect to when you design and test your flows. 

System
Required Information

NTO’s Sales Cloud

  • URLs of the NTO sandbox and production orgs
  • Username and password with appropriate permissions to the NTO orgs

Twilio

  • Email address and password
  • Account SID
  • Auth token
  • Twilio phone

Next, you learn about the prerequisites for your Sales Cloud environment.

Prerequisites for the Sales Cloud Environment

In this use case, every time an opportunity is marked closed won, a sales rep needs to send a text message about the event to the associated sales manager’s phone from the sales team’s Twilio phone in Twilio. 

To accomplish this, you have to store the sales manager’s phone and the sales team’s Twilio phone within each opportunity in Salesforce. Specifically, you must ensure that two custom fields of the phone data type, Twilio Phone and Sales Manager’s Phone, have been created for the Opportunity object in the NTO org. Here’s an example of Twilio Phone custom field for Opportunity in the NTO org.

Opportunity object with Twilio Phone custom field.

Here’s an example of Sales Manager’s Phone custom field for Opportunity in the NTO org.

Opportunity object with Sales Manager’s Phone custom field.

To learn how to create custom fields, see Customize a Salesforce Object.

Next, you learn about the prerequisites for your Twilio environment.

Prerequisites for the Twilio Environment

To perform integration tasks between Salesforce and Twilio using MuleSoft Composer, your Twilio account must have a Twilio phone—a phone number purchased from Twilio—to send text messages or make phone calls. You must also have a mobile phone to receive text messages and phone calls from Twilio.

If you have a paid Twilio account, find your account’s Twilio phone number by following these steps.

  1. Log in to Twilio using your email address and password.
  2. Click Console Dashboard. The Twilio phone number should appear in the Project Info section.

If you don’t have a paid Twilio account, you can sign up for a free trial Twilio account. After you’ve logged in to your account, obtain a Twilio phone number by following these steps.  

  1. Log in to Twilio using your email address and password.
  2. Click the # (Phone Numbers) icon.
  3. Click Get your first Twilio phone number. Twilio automatically selects a number for you.
  4. If you like this number, click Choose this Number. If not, click Search for a different number to find a number of your choice, and then click Choose this Number.

For your trial Twilio account, you must also verify a mobile phone number before you can send text messages and make phone calls to it. Follow these steps.

  1. In Twilio, click the # (Phone Numbers) icon.
  2. Click Verified Caller IDs and then click Verify a number.
  3. Click text you instead, enter a phone number, and then click Text Me to get a verification code. A verification code should be sent to your phone.
  4. Enter the verification code and click Submit. Your verified caller ID should appear.

Make a note of your Twilio phone number and your verified mobile phone number. You use these numbers in your MuleSoft Composer flow in the next unit.

Now let’s find out values for a Twilio connection.

Twilio Connection Parameters

When you create a connection to Twilio using MuleSoft Composer, you must specify values for the following parameters. 

Connection Display Name

The connection display name is any name of your choice.

Account SID and Auth Token

To find the account SID and auth token for a Twilio connection, follow these steps.

  1. Log in to Twilio using your email address and password.
  2. Click Console Dashboard.
  3. Copy and paste the account SID and auth token into a text file of your choice. You use these values to configure a Twilio connection in MuleSoft Composer.

You’ve taken the first steps to prepare to create your flow with MuleSoft Composer. In the next unit, you learn how to design and test your flow.

Resources 

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities