# Referencia del payload de email

Referencia para el mensaje `EmailPayload` utilizado por [`Notify`](/es/developer/api-reference/messaging-api-v2/notify/) al enviar un email.

<Aside type="note">
Para payloads de push / SMS / messenger, consulte la [Referencia de payload](/es/developer/api-reference/messaging-api-v2/payload-reference/).
</Aside>

## EmailPayload

- `subject` (map&lt;string, string&gt;): línea de asunto por configuración regional, p. ej., `{"en": "Hello!", "es": "¡Hola!"}`.
- `body` (string): cuerpo HTML del email. Para cuerpos HTML por configuración regional, use `email_template` con una [Plantilla de Email](/es/product/content/email-content/) configurada en el Panel de Control.
- `attachments` (array de [`Attachment`](#attachment)): archivos adjuntos.
- `list_unsubscribe` (string): URL personalizada para la cabecera `List-Unsubscribe`.
- `from` ([`Address`](#address)): sobrescribe el `From` por defecto configurado en los ajustes de email de la aplicación.
- `reply_to` ([`Address`](#address)): sobrescribe el `Reply-To` por defecto configurado en los ajustes de email de la aplicación.
- `email_template` (string): código de una [Plantilla de Email](/es/product/content/email-content/) para usar en lugar de un `body` en línea.

## Attachment

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

| Campo | Tipo | Descripción |
|---|---|---|
| `name` | string | Nombre del archivo tal como lo ve el destinatario. |
| `content` | string | Contenido del archivo codificado en Base64. |

## Address

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

Ambos campos son opcionales.
Si se omite `name`, el destinatario ve la dirección de email sin formato.

## Ejemplo: Enviar un email a un segmento

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

## Ejemplo: Email transaccional con archivo adjunto

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