Mailchimp · Schema

MessagePayload

The message object containing all parameters for a transactional email, including recipients, content, attachments, and tracking options.

CampaignsEmail MarketingMarketing AutomationNewslettersTransactional Email

Properties

Name Type Description
html string The full HTML content of the message.
text string The full plain-text content of the message.
subject string The message subject line.
from_email string The sender email address.
from_name string The sender display name.
to array An array of recipient objects.
headers object Optional extra headers to add to the message (e.g., Reply-To).
important boolean Whether this message is important and should be delivered ahead of non-important messages.
track_opens boolean Whether to enable open tracking for this message.
track_clicks boolean Whether to enable click tracking for this message.
auto_text boolean Whether to automatically generate a plain-text version from the HTML content.
auto_html boolean Whether to automatically generate HTML from the plain-text content.
inline_css boolean Whether to automatically inline all CSS styles from style blocks in the HTML content.
url_strip_qs boolean Whether to strip query strings from URLs when aggregating tracked click data.
preserve_recipients boolean Whether to show all recipients in the To header of each email.
view_content_link boolean Whether to include a View Content Link in the Mandrill dashboard for this message.
bcc_address string An optional address to BCC on the message.
tracking_domain string A custom domain to use for tracking opens and clicks.
signing_domain string A custom domain to use for DKIM signing instead of the default.
return_path_domain string A custom domain to use for the return-path header.
merge boolean Whether to evaluate merge tags in the message.
merge_language string The merge tag language to use (Mailchimp or Handlebars).
global_merge_vars array Global merge variables applied to all recipients.
merge_vars array Per-recipient merge variables.
tags array An array of string tags to apply to this message for analytics.
subaccount string The unique ID of a subaccount for this message.
google_analytics_domains array An array of domains for which Google Analytics tracking parameters will be appended.
google_analytics_campaign string The utm_campaign tracking parameter for Google Analytics.
metadata object Key-value metadata to associate with the message.
recipient_metadata array Per-recipient metadata.
attachments array An array of file attachments.
images array An array of inline images referenced with "cid:" in the HTML content.
View JSON Schema on GitHub

JSON Schema

mailchimp-messagepayload-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/MessagePayload",
  "title": "MessagePayload",
  "type": "object",
  "description": "The message object containing all parameters for a transactional email, including recipients, content, attachments, and tracking options.",
  "properties": {
    "html": {
      "type": "string",
      "description": "The full HTML content of the message.",
      "example": "example_value"
    },
    "text": {
      "type": "string",
      "description": "The full plain-text content of the message.",
      "example": "example_value"
    },
    "subject": {
      "type": "string",
      "description": "The message subject line.",
      "example": "example_value"
    },
    "from_email": {
      "type": "string",
      "format": "email",
      "description": "The sender email address.",
      "example": "[email protected]"
    },
    "from_name": {
      "type": "string",
      "description": "The sender display name.",
      "example": "example_value"
    },
    "to": {
      "type": "array",
      "description": "An array of recipient objects.",
      "items": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "description": "The recipient email address."
          },
          "name": {
            "type": "string",
            "description": "The recipient display name."
          },
          "type": {
            "type": "string",
            "enum": [
              "to",
              "cc",
              "bcc"
            ],
            "default": "to",
            "description": "The recipient type (to, cc, or bcc)."
          }
        }
      },
      "example": []
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Optional extra headers to add to the message (e.g., Reply-To).",
      "example": "example_value"
    },
    "important": {
      "type": "boolean",
      "default": false,
      "description": "Whether this message is important and should be delivered ahead of non-important messages.",
      "example": true
    },
    "track_opens": {
      "type": "boolean",
      "description": "Whether to enable open tracking for this message.",
      "example": true
    },
    "track_clicks": {
      "type": "boolean",
      "description": "Whether to enable click tracking for this message.",
      "example": true
    },
    "auto_text": {
      "type": "boolean",
      "description": "Whether to automatically generate a plain-text version from the HTML content.",
      "example": true
    },
    "auto_html": {
      "type": "boolean",
      "description": "Whether to automatically generate HTML from the plain-text content.",
      "example": true
    },
    "inline_css": {
      "type": "boolean",
      "description": "Whether to automatically inline all CSS styles from style blocks in the HTML content.",
      "example": true
    },
    "url_strip_qs": {
      "type": "boolean",
      "description": "Whether to strip query strings from URLs when aggregating tracked click data.",
      "example": "https://www.example.com"
    },
    "preserve_recipients": {
      "type": "boolean",
      "description": "Whether to show all recipients in the To header of each email.",
      "example": true
    },
    "view_content_link": {
      "type": "boolean",
      "description": "Whether to include a View Content Link in the Mandrill dashboard for this message.",
      "example": true
    },
    "bcc_address": {
      "type": "string",
      "format": "email",
      "description": "An optional address to BCC on the message.",
      "example": "example_value"
    },
    "tracking_domain": {
      "type": "string",
      "description": "A custom domain to use for tracking opens and clicks.",
      "example": "example_value"
    },
    "signing_domain": {
      "type": "string",
      "description": "A custom domain to use for DKIM signing instead of the default.",
      "example": "example_value"
    },
    "return_path_domain": {
      "type": "string",
      "description": "A custom domain to use for the return-path header.",
      "example": "example_value"
    },
    "merge": {
      "type": "boolean",
      "default": true,
      "description": "Whether to evaluate merge tags in the message.",
      "example": true
    },
    "merge_language": {
      "type": "string",
      "enum": [
        "mailchimp",
        "handlebars"
      ],
      "default": "mailchimp",
      "description": "The merge tag language to use (Mailchimp or Handlebars).",
      "example": "mailchimp"
    },
    "global_merge_vars": {
      "type": "array",
      "description": "Global merge variables applied to all recipients.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The global merge variable name."
          },
          "content": {
            "type": "string",
            "description": "The global merge variable value."
          }
        }
      },
      "example": []
    },
    "merge_vars": {
      "type": "array",
      "description": "Per-recipient merge variables.",
      "items": {
        "type": "object",
        "properties": {
          "rcpt": {
            "type": "string",
            "format": "email",
            "description": "The recipient email address."
          },
          "vars": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The merge variable name."
                },
                "content": {
                  "type": "string",
                  "description": "The merge variable value."
                }
              }
            }
          }
        }
      },
      "example": []
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "An array of string tags to apply to this message for analytics.",
      "example": []
    },
    "subaccount": {
      "type": "string",
      "description": "The unique ID of a subaccount for this message.",
      "example": "example_value"
    },
    "google_analytics_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "An array of domains for which Google Analytics tracking parameters will be appended.",
      "example": []
    },
    "google_analytics_campaign": {
      "type": "string",
      "description": "The utm_campaign tracking parameter for Google Analytics.",
      "example": "example_value"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Key-value metadata to associate with the message.",
      "example": "example_value"
    },
    "recipient_metadata": {
      "type": "array",
      "description": "Per-recipient metadata.",
      "items": {
        "type": "object",
        "properties": {
          "rcpt": {
            "type": "string",
            "format": "email",
            "description": "The recipient email address."
          },
          "values": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Key-value metadata for this recipient."
          }
        }
      },
      "example": []
    },
    "attachments": {
      "type": "array",
      "description": "An array of file attachments.",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The MIME type of the attachment."
          },
          "name": {
            "type": "string",
            "description": "The file name of the attachment."
          },
          "content": {
            "type": "string",
            "description": "Base64-encoded content of the attachment."
          }
        }
      },
      "example": []
    },
    "images": {
      "type": "array",
      "description": "An array of inline images referenced with \"cid:\" in the HTML content.",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "The MIME type of the image (e.g., image/png)."
          },
          "name": {
            "type": "string",
            "description": "The Content-ID of the image, referenced as \"cid:name\" in HTML."
          },
          "content": {
            "type": "string",
            "description": "Base64-encoded content of the image."
          }
        }
      },
      "example": []
    }
  }
}