Skip to main content
Use this guide to configure push notification templates, understand placeholders, and set sounds.

Quick flow

  • Pick privacy mode (default, privacy, or default with user override).
  • Edit templates for each event type (titles/bodies for default and privacy).
  • Save sounds (chat/call).

How templates work

  • Templates define the push title/body per event type.
  • Placeholders map to event payload fields and are resolved before delivery.
  • Configure in Dashboard → Notifications → Templates and Sounds; privacy toggle is under Preferences.
Example payload (new message) Key paths you can reference in placeholders are shown in this sample:
The sender’s name lives at message.data.entities.sender.entity.name, so use {{message.data.entities.sender.entity.name}} in templates.

Templates

1. Text message templates

2. User mention templates

User mention templates are used when a text message contains an @mention of a specific user. Only the mentioned user receives the notification using these templates — other recipients of the same message continue to receive the standard text message template. Applies to text messages (category: "message", type: "text") where the recipient is specifically @mentioned. If a message contains both @user and @all, the specifically mentioned user gets the user mention template (higher priority). Note: The “Body (Fallback)” value is utilized when any placeholders within the “Body” fail to resolve to an appropriate substitution value. For example, if {{message.data.text}} in the aforementioned scenario evaluates to null or undefined, the “Body (Fallback)” value will be utilized. Ideally, the “Body (Fallback)” value should not contain any placeholders to prevent additional resolution failures.

3. @all mention templates

@all mention templates are used when a text message contains an @all mention in a group conversation.
Group members who are not individually @mentioned receive notifications using these templates. Individually mentioned users receive notifications using the user mention templates instead.
Applies to text messages (category: "message", type: "text") where the message contains @all in a group conversation. Note: The “Body (Fallback)” value is utilized when any placeholders within the “Body” fail to resolve to an appropriate substitution value. For example, if {{message.data.text}} in the aforementioned scenario evaluates to null or undefined, the “Body (Fallback)” value will be utilized. Ideally, the “Body (Fallback)” value should not contain any placeholders to prevent additional resolution failures.

4. Media message templates

5. Custom message templates

Note: The “Body (Fallback)” value is utilized when any placeholders within the “Body” fail to resolve to an appropriate substitution value. For example, if {{message.data.text}} in the aforementioned scenario evaluates to null or undefined, the “Body (Fallback)” value will be utilized. Ideally, the “Body (Fallback)” value should not contain any placeholders to prevent additional resolution failures.
By default, messages with category: "custom" do not trigger any notifications (push, email, or SMS). To opt in, set sendNotification: true in the message’s data payload.Set sendNotification: true for custom messages that represent user-facing activity (e.g., polls, payments, shared locations). Omit the flag for background or system-level custom messages that should not interrupt the recipient.

6. Poll message templates

Applies to messages with category: "custom" and type: "extension_poll". Poll templates use the same structure as custom message templates and can be customized independently — for example, setting the privacy body to “New poll” instead of the generic fallback. Note: The “Body (Fallback)” value is utilized when any placeholders within the “Body” fail to resolve to an appropriate substitution value. For example, if {{message.data.text}} in the aforementioned scenario evaluates to null or undefined, the “Body (Fallback)” value will be utilized. Ideally, the “Body (Fallback)” value should not contain any placeholders to prevent additional resolution failures.

7. Reminder message templates

Applies to messages with category: "custom" and type: "extension_reminders". Reminder templates use the same structure as custom message templates and can be customized independently — for example, setting the privacy body to “New reminder” instead of the generic fallback. Note: The “Body (Fallback)” value is utilized when any placeholders within the “Body” fail to resolve to an appropriate substitution value. For example, if {{message.data.text}} in the aforementioned scenario evaluates to null or undefined, the “Body (Fallback)” value will be utilized. Ideally, the “Body (Fallback)” value should not contain any placeholders to prevent additional resolution failures.

8. Interactive form templates

9. Interactive card templates

10. Interactive scheduler templates

11. Custom Interactive message templates

Dashboard configuration

Choose how templates apply to users: default, privacy, or default with user override (Privacy Setting dropdown in the dashboard).

Client-side implementation

1. Fetch privacy setting Fetch/update the privacy toggle so users can opt in when allowed.
2. Update privacy setting CometChatNotifications.updatePreferences() method is used to update a user’s notification preferences. The “override” toggle defined in the dashboard is crucial when updating preferences. If any preference is non-overridable, the method doesn’t generate an error; it instead returns the NotificationPreferences object with the updated values where overrides are allowed. Use this sparingly to avoid surprising users. Set only the preferences that changed.

Template tips

  • Keep privacy variants generic to avoid leaking message content.
  • Use sender@group style for group titles to disambiguate conversations.
  • Avoid placeholders in fallback text to prevent unresolved values.

Group call notifications

Group call notifications (e.g., “User started a group call”) are sent as custom messages (category: "custom"), not as group action messages. This means they are governed by the custom message templates above, and the GROUP_ACTIONS_PREFERENCE setting does not affect group call notifications.If you want to suppress or customize group call notifications independently, configure the custom message template or handle them in your client-side notification logic.

Sounds

Include sound files in your app bundle and set the sound field in the push payload to the filename (omit extension if your platform expects that).