Workflows Template: Send SMS with Twilio
Workflows templates are out-of-the-box flows and automations that you can add and start using right away. Each template provides a specific and real world solution.
In this blog post you will learn about the Send SMS with Twilio template.
Why it’s important
Within a workflow you may want to send a message, an alert, a pin, or any type of information via SMS to a user.
Template overview
This flow creates a text messages and sends it via Twilio SMS API. The flow is meant to be called as a helper flow. This means you can call it from any other flow.
The template has one flow:
- SUB – Send SMS via Twilio
Template flow steps
Note: I removed a number of Notes cards from the flow(s) so all all cards can fit into a screenshot.
The flow SUB – Send SMS via Twilio has the following steps:
- The On Demand – Child Flow card makes this flow a helper flow. This means the flow can be invoked from any other low. This helper flow has four inputs:
To phone number
message
Twilio Account SID
From phone number
- The second card Object – Construct, creates an object (JSON object) with required header information for Twilio SMS API call
- The third card, Text – Compose puts together additional parameters to be used with Twilio SMS call. The card concatenates
To phone number
,message
, andFrom phone number
information - The next Text – Compose card sets the Twilio endpoint with the
Account SID
information - The last card, API Connector – Post makes an API call to Twilio to send the text message
Flow chart for the two flows looks like this:
Twilio account
You need a Twilio account with a number from which you can send SMS messages. In your Twilio account go to the console. There you will see the information you need to send SMS messages. You will need Account SID
, Auth Token
and My Twilio phone number
.
Template setup
How to add and setup the template.
Running the flow
To test the flow click the Test button and enter the input that the flow requires.
Note that From phone number is your Twilio number.
Published on Java Code Geeks with permission by Max Katz , partner at our JCG program. See the original article here: Workflows Template: Send SMS with Twilio Opinions expressed by Java Code Geeks contributors are their own. |