Skip to main content
Use these payload fields when rendering your own email bodies. No sounds apply to email. Providers like SendGrid can consume these fields—map them into Dynamic Template variables or assemble the subject/body in your service before sending.

Payload shapes

Field meanings:
  • to: recipient identifiers and optional email.
  • messages[]: the unread messages that triggered the notification (use for counts and previews).
  • senderDetails: most recent sender; map to subjects or hero text.
  • groupDetails: only present for group conversations.
  • subject: ready-to-use subject if you do not build it in the provider.

One-on-one

{
  "to": { "uid": "customer-123", "email": "andrew@example.com", "name": "Andrew Joseph" },
  "messages": [
    {
      "sender": { "uid": "agent-42", "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", "name": "Susan Marie" },
      "message": "Are we meeting this weekend?",
      "messageObject": { "category": "message", "type": "text" }
    },
    {
      "sender": { "uid": "agent-42", "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", "name": "Susan Marie" },
      "message": "📷 Has shared an image"
    }
  ],
  "senderDetails": { "uid": "agent-42", "name": "Susan Marie", "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp" },
  "subject": "New messages from Susan Marie"
}

Group

{
  "to": { "uid": "customer-123", "name": "Andrew Joseph" },
  "messages": [
    { "sender": { "uid": "mod-5", "name": "John Paul" }, "message": "Hello all! What's up?" },
    { "sender": { "uid": "agent-42", "name": "Susan Marie" }, "message": "This is the place I was thinking about" }
  ],
  "groupDetails": { "guid": "community-1", "name": "Hiking Group" },
  "subject": "New messages in Hiking Group"
}

Subject examples

You can use the provided subject field or build your own using senderDetails.name and groupDetails.name. Here are default and privacy-focused subject templates:
Use caseDefault subjectPrivacy subjectExample result (default)
One-on-one notificationNew messages from {{senderDetails.name}}New messages from {{senderDetails.name}}New messages from Susan Marie
Group notificationNew messages in {{groupDetails.name}}New messages in {{groupDetails.name}}New messages in Hiking Group