跳到内容

Email payload reference

此内容尚未提供您的语言版本。

Reference for the EmailPayload message used by Notify when sending email.

EmailPayload

Anchor link to
  • subject (map<string, string>): subject line keyed by locale, e.g. {"en": "Hello!", "es": "¡Hola!"}.
  • body (string): HTML body of the email. For per-locale HTML bodies, use email_template with an Email Template configured in the Control Panel.
  • attachments (array of Attachment): file attachments.
  • list_unsubscribe (string): custom URL for the List-Unsubscribe header.
  • from (Address): override the default From configured in the app’s email settings.
  • reply_to (Address): override the default Reply-To configured in the app’s email settings.
  • email_template (string): code of an Email Template to use instead of an inline body.

Attachment

Anchor link to
{
"name": "invoice.pdf",
"content": "<base64-encoded bytes>"
}
FieldTypeDescription
namestringFile name as the recipient sees it.
contentstringBase64-encoded file content.
{
"name": "Pushwoosh",
"email": "support@example.com"
}

Both fields are optional. If name is omitted, the recipient sees the raw email address.

Example: Send an email to a segment

Anchor link to
Terminal window
curl -X POST https://api.pushwoosh.com/messaging/v2/notify \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"segment": {
"application": "XXXXX-XXXXX",
"platforms": ["EMAIL"],
"code": "newsletter_subscribers",
"email_payload": {
"subject": { "en": "Our May updates", "es": "Novedades de mayo" },
"email_template": "may-digest-2026",
"from": { "name": "Pushwoosh Team", "email": "news@example.com" },
"reply_to": { "email": "replies@example.com" }
},
"schedule": { "at": "2026-05-01T09:00:00Z" },
"message_type": "MESSAGE_TYPE_MARKETING"
}
}'

Example: Transactional email with attachment

Anchor link to
Terminal window
curl -X POST https://api.pushwoosh.com/messaging/v2/notify \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"transactional": {
"application": "XXXXX-XXXXX",
"platforms": ["EMAIL"],
"users": { "list": ["customer-42"] },
"email_payload": {
"subject": { "en": "Your invoice" },
"body": "<p>Please find your invoice attached.</p>",
"attachments": [
{ "name": "invoice.pdf", "content": "JVBERi0xLjQKJe..." }
]
},
"schedule": { "at": "2026-05-01T12:00:00Z" },
"message_type": "MESSAGE_TYPE_TRANSACTIONAL"
}
}'