---
url: https://talkjs.com/docs/Features/Notifications/SMS_Notifications
---

# SMS notifications

Ask a question Copy for LLM [View as Markdown](/docs/Features/Notifications/SMS_Notifications.md)
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](/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:

- [Twilio](https://www.twilio.com/en-us/messaging/channels/sms)
- [Amazon SNS](https://aws.amazon.com/sns/)
To connect a provider, go to **Settings → SMS notifications** on your [TalkJS dashboard](/dashboard) and select it from the dropdown.

If you want to use a different SMS provider, you can listen to the [`notification.triggered`](/docs/Webhooks/#notificationtriggered) 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.

### Link back to your app

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](/dashboard).

You can either add a plain link, for example `https://example.com`, or use [template macros](#customize-content-with-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](/docs/Concepts/Roles/).

#### Link to a user's inbox

If you're using the [Inbox prebuilt chat UI](/docs/Features/Chat_UIs/#inbox), 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:

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

and TalkJS generates a URL to select the correct conversation.

#### Link to a product or order page

You can link straight to a page about a product or order, by adding a [custom field](/docs/Concepts/Conversations/#conversation-data) 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:

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

With a [chatbox](/docs/Features/Chat_UIs/#chatbox) or [pop-up](/docs/Features/Chat_UIs/#popup) 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](/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](/docs/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 type | Max characters per segment | Notes |
| --- | --- | --- |
| Standard GSM | 160 characters | Default encoding |
| UCS-2 | 70 characters | Used 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](/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](#supported-sms-providers).

## Related topics

- [Webhooks](/docs/Webhooks/): receive events related to SMS notifications (`notification.triggered`, `notification.sent`)
- [Participants](/docs/REST_API/Participation/): turn notifications on or off per conversation