Email payload reference
Reference for the EmailPayload message used by Notify when sending email.
EmailPayload
Anchor link tosubject(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, useemail_templatewith an Email Template configured in the Control Panel.attachments(array ofAttachment): file attachments.list_unsubscribe(string): custom URL for theList-Unsubscribeheader.from(Address): override the defaultFromconfigured in the app’s email settings.reply_to(Address): override the defaultReply-Toconfigured in the app’s email settings.email_template(string): code of an Email Template to use instead of an inlinebody.email_sunset_policy(EmailSunsetPolicy): how the project’s sunset policy applies to this email. If omitted, the policy applies.
EmailSunsetPolicy
Anchor link tomode 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"}mode | Who gets the email |
|---|---|
EMAIL_SUNSET_MODE_DEFAULT | Active contacts only: inactive contacts are skipped. Same as omitting email_sunset_policy. |
EMAIL_SUNSET_MODE_OFF | All 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>"}| Field | Type | Description |
|---|---|---|
name | string | File name as the recipient sees it. |
content | string | Base64-encoded file content. |
Address
Anchor link to{ "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 tocurl -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 tocurl -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" } }'