> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS Templates

> SMS Templates — CometChat documentation.

Design the SMS body users receive for unread-message alerts. Sounds do not apply to SMS. Map these payload fields into your provider template or assemble the text in your service before sending.

## What to customize

* **Body text** for 1:1 and group SMS (default vs privacy-friendly).
* **Preview and counts** from `messages[]` plus `senderDetails`/`groupDetails`.
* **Link back** to your app (add in your template).

## Payload shapes

Field meanings:

* `to`: recipient identifier and phone number.
* `messages[]`: unread messages that triggered the SMS; use for counts and previews.
* `senderDetails`: most recent sender; helpful for subject-style copy.
* `groupDetails`: present for group conversations.
* `smsContent`: an optional, ready-to-send string if you want to use it directly.

### One-on-one

```json theme={null}
{
  "to": { "uid": "cometchat-uid-1", "phno": "+919299334134", "name": "Andrew Joseph" },
  "messages": [
    { "sender": { "uid": "cometchat-uid-4", "name": "Susan Marie" }, "message": "Are we meeting on this weekend?" },
    { "sender": { "uid": "cometchat-uid-4", "name": "Susan Marie" }, "message": "📷 Has shared an image" }
  ],
  "senderDetails": { "uid": "cometchat-uid-4", "name": "Susan Marie" },
  "smsContent": "You've received new messages from Susan Marie! Read them at https://your-website.com/chat."
}
```

### Group

```json theme={null}
{
  "to": { "uid": "cometchat-uid-1", "phno": "+919299334134", "name": "Andrew Joseph" },
  "messages": [
    { "sender": { "uid": "cometchat-uid-5", "name": "John Paul" }, "message": "Hello all! What's up?" },
    { "sender": { "uid": "cometchat-uid-4", "name": "Susan Marie" }, "message": "📷 Has shared an image" }
  ],
  "groupDetails": { "guid": "cometchat-guid-1", "name": "Hiking Group" }
}
```

## Template examples

You can use the provided `smsContent` field or build your own using `senderDetails`, `groupDetails`, and `messages.length`. Here are default and privacy-focused templates:

<Frame>
  <img src="https://mintcdn.com/cometchat-22654f5b/l9jOOlwBkJ6-pebk/images/sms-notification-templates.png?fit=max&auto=format&n=l9jOOlwBkJ6-pebk&q=85&s=295f2547d5248331240cf7de4ab1dcd8" width="2500" height="598" data-path="images/sms-notification-templates.png" />
</Frame>

| Use case                | Default template                                                                                                                                   | Privacy template                                                                                                                                   | Example result (default)                                                                                          |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| One-on-one notification | You've received `{{messages.length}}` message(s) from `{{senderDetails.name}}`! Read them at [https://your-website.com](https://your-website.com). | You've received `{{messages.length}}` message(s) from `{{senderDetails.name}}`! Read them at [https://your-website.com](https://your-website.com). | You've received 2 message(s) from Susan Marie! Read them at [https://your-website.com](https://your-website.com). |
| Group notification      | You've received `{{messages.length}}` message(s) in `{{groupDetails.name}}`! Read them at [https://your-website.com](https://your-website.com).    | You've received `{{messages.length}}` message(s) in `{{groupDetails.name}}`! Read them at [https://your-website.com](https://your-website.com).    | You've received 2 message(s) in Hiking Group! Read them at [https://your-website.com](https://your-website.com).  |

## Tips

* Keep bodies short to respect SMS length/carrier rules; consider removing URLs in privacy mode.
* Use `messages.length` for counts and `senderDetails.name`/`groupDetails.name` for context.
* Add your app link in the template; ensure it is trackable and domain-verified per provider.
