# E-Mail-Payload-Referenz

Referenz für die `EmailPayload`-Nachricht, die von [`Notify`](/de/developer/api-reference/messaging-api-v2/notify/) beim Senden von E-Mails verwendet wird.

<Aside type="note">
Informationen zu Payloads für Push / SMS / Messenger finden Sie in der [Payload-Referenz](/de/developer/api-reference/messaging-api-v2/payload-reference/).
</Aside>

## EmailPayload

- `subject` (map&lt;string, string&gt;): Betreffzeile nach Locale verschlüsselt, z. B. `{"en": "Hello!", "es": "¡Hola!"}`.
- `body` (string): HTML-Body der E-Mail. Für HTML-Bodies pro Locale verwenden Sie `email_template` mit einer im Control Panel konfigurierten [E-Mail-Vorlage](/de/product/content/email-content/).
- `attachments` (Array von [`Attachment`](#attachment)): Dateianhänge.
- `list_unsubscribe` (string): benutzerdefinierte URL für den `List-Unsubscribe`-Header.
- `from` ([`Address`](#address)): überschreibt das standardmäßige `From`, das in den E-Mail-Einstellungen der App konfiguriert ist.
- `reply_to` ([`Address`](#address)): überschreibt das standardmäßige `Reply-To`, das in den E-Mail-Einstellungen der App konfiguriert ist.
- `email_template` (string): Code einer [E-Mail-Vorlage](/de/product/content/email-content/), die anstelle eines Inline-`body` verwendet wird.

## Attachment

```json
{
  "name": "invoice.pdf",
  "content": "<base64-encoded bytes>"
}
```

| Feld | Typ | Beschreibung |
|---|---|---|
| `name` | string | Dateiname, wie ihn der Empfänger sieht. |
| `content` | string | Base64-kodierter Dateiinhalt. |

## Address

```json
{
  "name":  "Pushwoosh",
  "email": "support@example.com"
}
```

Beide Felder sind optional.
Wenn `name` weggelassen wird, sieht der Empfänger die reine E-Mail-Adresse.

## Beispiel: Senden einer E-Mail an ein Segment

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

## Beispiel: Transaktions-E-Mail mit Anhang

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