Skip to main content
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

{
  "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

{
  "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:
Use caseDefault templatePrivacy templateExample result (default)
One-on-one notificationYou’ve received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com.You’ve received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com.You’ve received 2 message(s) from Susan Marie! Read them at https://your-website.com.
Group notificationYou’ve received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.You’ve received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.You’ve received 2 message(s) in Hiking Group! Read them at 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.