Skip to main content
{
  "from": {
    "email": "[email protected]",
    "name": "Support Team"
  },
  "to": [
    {
      "email": "[email protected]",
      "name": "Jane Smith",
      "customFields": {
        "orderNumber": "ORD-12345"
      }
    }
  ],
  "subject": "Your Order #{{orderNumber}} has been shipped",
  "htmlBody": "<p>Hi Jane,</p><p>Your order has been shipped and is on its way!</p>",
  "textBody": "Hi Jane,\n\nYour order has been shipped and is on its way!",
  "trackOpens": true,
  "trackClicks": true,
  "groups": [
    "transactional",
    "order-updates",
    "shipping-notifications"
  ]
}

Overview

Groups are optional string arrays that categorize emails. Assign multiple groups per email to organize by type, campaign, product line, or any classification. Use groups to filter and analyze performance via the Stats API.

Features

  • Multiple groups per email: Assign an array of group names to a single email (e.g., ["transactional", "order-updates"]).
  • Flexible naming: Use any string naming convention.
  • Analytics filtering: Filter stats and analyze performance by category.
  • Optional: Omit groups if not needed.

Common Use Cases

Separating Transactional and Promotional Emails

{
  "groups": ["transactional"]
}
or
{
  "groups": ["promotional"]
}

Tracking Campaigns

{
  "groups": ["summer-sale-2024", "email-campaign"]
}

Product Line Classification

{
  "groups": ["product-electronics", "product-accessories"]
}

Email Type Classification

{
  "groups": ["welcome-series", "user-onboarding", "week-1"]
}

Examples

Transactional Email

{
  "subject": "Order Confirmation",
  "groups": ["transactional", "order-confirmation"],
  "htmlBody": "<p>Thank you for your order!</p>"
}

Promotional Email

{
  "subject": "Special Offer - 50% Off!",
  "groups": ["promotional", "summer-sale"],
  "htmlBody": "<p>Don't miss our summer sale!</p>"
}

Newsletter

{
  "subject": "Monthly Newsletter - July 2024",
  "groups": ["newsletter", "monthly-updates"],
  "htmlBody": "<p>Here's what's new this month...</p>"
}

Using Groups with the Stats API

Filter and analyze performance by group using the Get aggregated stats by group endpoint. Compare performance across email types, campaigns, or product lines.
Groups are case-sensitive. Use consistent naming conventions (e.g., always lowercase or always kebab-case) to avoid duplicate groups.
Groups are stored with each email message and included in webhook payloads. Filter webhook events by group in your application.