How emails are structured
The structure of the request JSON payload represents the email you want to send. Among other things, it defines the sender, recipients, subject, and body of an email. Thepersonalizations field allows you to specify unique content for each
recipient of an email. You can create highly targeted and individualized email campaigns within a single API call.
Basic structure
Thepersonalizations array applies per-recipient overrides on top of the root-level fields. This structure allows for
sending to multiple recipients, customizing subject lines per recipient, and applying different headers or DKIM settings
per email.
The example below sends a fruit sale to three recipients. The first two entries override the sender, subject, and cc/bcc
recipients; the third entry only overrides the subject and falls back to the root-level sender:
When a property is defined both globally and in a personalization object, the value in the personalization object is used.
Field types
Detailed definitions of each field can be found in the API reference.The
to field is the only required property within each personalization object.personalizations: Array of objects (recipient-specific data)from: Object (sender information)subject: Stringcontent: Array of objects (email body parts)
content object contains:
type: String (e.g., “text/plain”, “text/html”)value: String (actual content)
EmailAddress object (sender or recipient information) contains:
name: String, optional. Display name as raw, unencoded text (e.g.,John Doe,张三).email: String (e.g.,foo@example.com).
Always provide the
name field as raw, unencoded text to prevent double-encoding issues.
Special characters and non-ASCII text will be automatically handled for email compatibility.
