SMS messaging
Tovie Platform supports sending SMS messages right from the script. For that, you have to buy an SMS package. Contact bd@tovie.ai for more details.
Supported channels
You can send SMS messages from:
- The phone channel.
- Inbound channels, except Slack.
How to use
There are two ways you can configure sending SMS messages:
- Use the
sms
reply type in the script. To handle successful or failed SMS message delivery, specify thesmsSuccessEvent
andsmsFailedEvent
events. - Add the
Sms
action tag to the script and specify the necessary parameters: the recipient phone number and message text.
Message length
There are character limits for SMS messages:
-
Messages with Arabic, Chinese, Cyrillic, Hindi, Japanese, and Korean characters may contain no more than 70 characters.
tipIf there is at least one, for example, Arabic character in the message, then the whole message is considered to be in Arabic. -
Messages with Latin characters only may contain no more than 160 characters.
-
One emoji counts as one character.
-
The following characters count as two characters:
\f
,^
,{
,}
,\
,[
,~
,]
,|
,€
. -
If the message length exceeds than the allowed length, the message will be segmented when it is sent. Each segment is billed as a separate message, but the recipient will get a single message.
Custom SMS sender ID
If you have set a configuration with the Vonage provider, you can specify the sender ID. Otherwise, NXSMS
will be displayed as the SMS sender.
To configure a sender ID:
- Sign up for Vonage and obtain your SMS API credentials.
- Pass the provider configuration in the
providerConfiguration
object.
Examples
In this example, the client with the 16123456789
phone number receives an SMS message Your order has been successfully completed when switching to the Confirmation
state.
If the SMS message is delivered successfully, the message Thanks for your order! We have sent your order details in an SMS message will be displayed in the chat.
- SMS reply type usage
- SMS action tag usage
state: Confirmation
script:
var reply = {
"type": "sms",
"text": "Your order has been successfully completed",
"destination": "16123456789"
};
$response.replies = $response.replies || [];
$response.replies.push(reply);
state: Success
event: smsSuccessEvent
a: Thanks for your order! We have sent your order details in an SMS message.
state: Confirmation
Sms:
text = Your order has been successfully completed.
destination = 16123456789
okState = /Confirmation/Success
state: Success
a: Thanks for your order! We have sent your order details in an SMS message.