Skip to content

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.
  • email_sunset_policy (EmailSunsetPolicy): how the project’s sunset policy applies to this email. If omitted, the policy applies.

EmailSunsetPolicy

Anchor link to

mode takes effect only when the sunset policy is turned on for the project. The policy is not turned on by default, and until it is, both modes send to every contact.

{
"mode": "EMAIL_SUNSET_MODE_OFF"
}
modeWho gets the email
EMAIL_SUNSET_MODE_DEFAULTActive contacts only: inactive contacts are skipped. Same as omitting email_sunset_policy.
EMAIL_SUNSET_MODE_OFFAll contacts, inactive ones included. Use it for an important marketing email that must reach everyone.

The sunset policy applies only to marketing emails, so email_sunset_policy has no effect on transactional emails.

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"
}
}'