Twilio
Supported actions
Swrve’s Twilio integration supports the following actions:
Outbound actions
- Send SMS or MMS message
Inbound actions
- Use SMS deliverability status events to trigger other actions in Swrve
Use cases
Send SMS or MMS message
Send SMS or MMS messages in response to a user’s real-time action in the app. For example, send a booking confirmation or purchase receipt if a customer opts into receiving them via text message.
There are two main steps involved in sending an SMS or MMS message via the Twilio integration:
- Create a custom event in the Swrve SDK for the user action you want to use to send a message; for example, booking_confirmed.
- Create a rule in Swrve that is triggered on receipt of the designated event and uses the Send Message action to send an SMS or MMS message. (Note: Sending images is currently only possible in the US and Canada.)
Take action on SMS deliverability status
After sending an SMS, use the SMS deliverability status events as triggers for other Swrve actions. For example, send an email confirmation if a message status is Undelivered.
Twilio configuration
In most instances, your CSM will set up your Twilio configuration, however you might need to provide them with certain credentials. To view your active Swrve integrations, on the Manage menu, select Adaptors.
Step 1: To access the configuration settings, on the Twilio card, select Configure.
Step 2: Complete the following fields as required:
Field | Description |
---|---|
Account SID | Your Twilio account SID that is used as the username for authentication purposes. To view this value, log in to your Twilio dashboard, under Account Summary. |
Auth Token | Your Twilio auth token that is used as the password for authentication purposes. To view this value, log in to your Twilio dashboard, under Account Summary. |
Step 3: To save the configuration settings, select Save.
After you select Save, the configuration status of the changes to Active and the Deactivate button is available.
Twilio actions
This section describes the fields that are included when creating a new rule using the selected action. For certain inbound actions, Swrve automatically creates a rule, while your CSM will likely configure any outbound actions. Most fields have the option to manually enter the value or to select a user property from the list to have Swrve automatically populate the value when the rule is processed.
Send message
Send a text or picture message to a customer from Twilio. Complete the following fields to include the values required to send the message.
Field | Required / Optional | Description |
---|---|---|
Message Body | Required | The text of the message you want to send, limited to 1600 characters. You must include either the Message Body or MediaURL. |
Message Recipient Phone Number | Required | The destination phone number. Format with a ‘+’ and country code, for example, +16175551212 (E.164 format). |
Sender Number | Required | A Twilio phone number (in E.164 format) or alphanumeric sender ID enabled for the type of message you wish to send. Phone numbers or short codes purchased from Twilio work here. You cannot (for example) spoof messages from your own cell phone number. |
Messaging Service SID | Optional | The 34 character unique ID of the Messaging Service you want to associate with this message. Set this parameter to use the Messaging Service Settings and Copilot Features you have configured in Twilio. When only this parameter is set, Twilio uses your enabled Copilot Features to select the From phone number for delivery. |
MediaURL | Optional | To send an MMS message, include the URL of the media you wish to send. gif, png and jpeg content is currently supported and will be formatted correctly on the recipient’s device. Other types are also accepted by the Twilio API. The media size limit is 5MB. To send more than one image in the message body, provide multiple MediaURL values. You may include up to 10 MediaURLs per message. You must include either the Message Body or MediaURL. |
Inbound actions
When an action triggers the above rule, the SMS parameters include an API request to Twilio that results in Twilio sending any changes to the SMS status back to Swrve as events. You can then use those events as triggers for other actions in Swrve. The available events are:
Status | Description |
---|---|
black_listed_error | Sent when a user replies STOP to the SMS message, as a means of tracking unsubscribes. |
Delivered | Twilio has received confirmation of message delivery from the upstream carrier, and, where available, the destination device. |
Failed | The message could not be sent. This can happen for various reasons including queue overflows, account suspensions and media errors (in the case of MMS). |
Queued | The API request to send a message was successful and the message is queued to be sent out. This is the initial status when you are not using a Messaging Service. |
Sent | The message was successfully accepted by the nearest upstream carrier. |
Undelivered | Twilio has received a delivery receipt indicating that the message was not delivered. This can happen for a number of reasons including carrier content filtering, availability of the destination device, and so on. |