The Twilio Connector provides an SMS_RECEIVED event that allows inbound SMS messages to be monitored and events published when specific criteria are met. Use this event to trigger automation based on incoming text messages from external users or systems.
The input parameters of a trigger are:
| Parameter | Description |
|---|---|
| condition | A condition that determines whether the trigger publishes an event. For more details on conditions available as a part of the input values, see Creating Conditions. |
| pattern | A regular expression that determines which SMS messages trigger an event. Capture groups can be used to extract values from matching messages, for example: Order Number (?<orderNumber>.+) The variables can then be used in echo and echoError, for example: ${orderNumber} |
| echo | A message sent to the original sender when the incoming SMS matches the configured pattern, for example: Your reference number is ${orderNumber}. |
| echoError | A message sent to the original sender if an error occurs while publishing the event: There was a problem publishing that event. |
Note:
Regular expression capture groups can be referenced in trigger actions through the matchGroups object. For example, the following pattern captures an order number: Order Number (?<orderNumber>.+). The captured value can then be referenced in messages: ${matchGroups.orderNumber}, for example: Your reference number is ${matchGroups.orderNumber}.