---
title: email.unsubscribed
description: The recipient opted out, by link, one-click header, or reply.
sidebar:
  label: email.unsubscribed
  icon: bell-off
---

The recipient opted out.

## Payload

| Prop | Type | Default | Description |
| - | - | - | - |
| `email_id` | `string` | - | The message they opted out from. |
| `domain_id` | `string \| null` | - | The domain that message was sent from; null when it went through a mailbox, or is gone. |
| `mailbox_id` | `string \| null` | - | The mailbox that message was sent through; null when it went from a domain, or is gone. |
| `address` | `string` | - | Who opted out. |
| `key` | `string` | - | The suppression list. `*` is the whole workspace's, or the whole space's when the send was from one. |
| `scope` | `"all" \| "optional"` | - | Whether they blocked everything or only optional mail. |
| `source` | `"link" \| "one_click" \| "reply"` | - | How: the unsubscribe link, the mail client's one-click header, or a reply that read as an opt-out. |

## Handling it

```ts
if (event.type === "email.unsubscribed") {
  await recordOptOut(event.data.address, event.data.key, event.data.scope)
}
```

Mirror this into your own preference UI so a customer who unsubscribed by email doesn't see themselves still subscribed in your app.

`scope: "optional"` means they blocked marketing but still want the receipts and password resets — don't collapse it to a single "unsubscribed" boolean.
