SMS notifications

TalkJS can automatically send SMS notifications to users who are offline, letting them know about new messages they’ve missed. SMS notifications are ideal for reaching users who might not always have access to your app or email.

You can modify the SMS notification message directly from your TalkJS dashboard, under Notifications → SMS settings.

Enable SMS notifications

Any user with a phone number automatically receives SMS notifications after they’ve been offline for a while. To enable SMS notifications for a user, make sure that the user has at least one phone number on record.

A user's phone number should be in full international format and start with a +. Users can have more than one phone number. If a user has multiple phone numbers, TalkJS notifies all phone numbers on record.

Supported SMS providers

TalkJS supports the following SMS providers:

To connect a provider, go to Settings → SMS notifications on your TalkJS dashboard and select it from the dropdown.

If you want to use a different SMS provider, you can listen to the notification.triggered webhook and send the message through your chosen provider when you receive an event.

Customize SMS content

Use macro syntax

You can personalize your SMS notifications using macros, such as Hello {{recipient.name}}!. You can use macros directly in the SMS template field on the Notifications page of your TalkJS dashboard.

Some carriers automatically reject SMS messages that include links. If you have any message delivery issues, try removing all links from your SMS notification message.

You can link back to your site or app directly from your SMS notifications, so that users can easily rejoin the conversation. Add your link in the SMS template field on the Notifications page of your TalkJS dashboard.

You can either add a plain link, for example https://example.com, or use template macros to let TalkJS build the URL to go directly to the correct page or conversation.

The SMS template applies globally to all users, unless overridden per user role.

If you're using the Inbox prebuilt chat UI, you can make your link immediately select the right conversation. For example, if you have a user's inbox on https://example.com/inbox and their conversation ID is 123456, you can add the conversation ID in a query parameter: https://example.com/inbox?conversation=123456. With a template macro, you could then add the following:

1https://example.com/inbox?conversation={{conversation.id}}

and TalkJS generates a URL to select the correct conversation.

You can link straight to a page about a product or order, by adding a custom field to the conversation to identify the product or order. For example, you could pass {"productId": "12345"} when creating the conversation, and then configure the URL as follows:

1https://yoursite.com/orders/{{conversation.custom.productId}}

With a chatbox or pop-up embedded on the destination page, users can directly continue their conversation right there.

Opt-out of SMS notifications

Users in the United States and Canada can unsubscribe from SMS notifications by replying with any of the following keywords:

  • ARRET (French)
  • CANCEL
  • END
  • OPT-OUT
  • OPTOUT
  • QUIT
  • REMOVE
  • STOP
  • TD

To enable opt-out replies, go to Notifications → SMS settings in your TalkJS dashboard and select Enable an opt-out via reply text for supported regions.

You can add custom help text to the end of your SMS notifications to let users in the US and Canada know they can opt out by replying.

After a user replies with one of the opt-out keywords, the phone number they replied from won't receive any further SMS notifications from TalkJS. If the user has more than one phone number, the other phone numbers will continue to receive SMS notifications.

Turn off SMS notifications

To turn off SMS notifications for a user, you can remove the user's phone numbers. To remove all phone numbers for a user, set the phoneNumbers field to null.

You can also mute notifications for a particular conversation via the REST API, in which case your user won't receive any notifications for that conversation, including SMS notifications.

SMS pricing

SMS notifications are billed per segment. A segment is one part of a longer message that exceeds the character limit for a single SMS. Segments are automatically reassembled into one message on the recipient’s device.

The maximum number of characters per segment depends on the encoding type:

Encoding typeMax characters per segmentNotes
Standard GSM160 charactersDefault encoding
UCS-270 charactersUsed for messages with Unicode characters (such as Arabic, Chinese, Cyrillic, and more) TalkJS automatically doubles the maximum segment length if a user sends a message with special characters that needs UCS-2 encoding.

You can set the maximum number of segments in which a single notification message can be sent on the Notifications page of your TalkJS dashboard.

The exact costs of sending an SMS notification vary per country code of the phone number that the notification is sent to.

Free monthly SMS credit

Each plan includes a free monthly SMS credit with a soft limit of $10.00. If you consistently exceed this limit, you’ll be asked to start sending SMS notifications through your own SMS provider.

  • Webhooks: receive events related to SMS notifications (notification.triggered, notification.sent)
  • Participants: turn notifications on or off per conversation