> ## Documentation Index
> Fetch the complete documentation index at: https://docs.younegotiate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Unsubscribe Email

> Jane clicks unsubscribe from a campaign email.

## Real-World Example

Jane clicks unsubscribe from a campaign email. The portal should verify the signed unsubscribe data, update her email preference, and prevent future optional email campaigns that must respect that opt-out.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Consumer clicks unsubscribe link"] --> B["Portal validates signed unsubscribe data"]
    B --> C{"Link valid?"}
    C -->|Yes| D["Email preference is updated"]
    C -->|No| E["Portal rejects unsafe unsubscribe request"]
    D --> F["Future eligible emails respect opt-out"]
    classDef default fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef actor fill:#E0F2FE,stroke:#0284C7,stroke-width:2px,color:#0C4A6E;
    classDef system fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef decision fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F;
    classDef risk fill:#FEE2E2,stroke:#DC2626,stroke-width:2px,color:#7F1D1D;
    classDef outcome fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D;
    class A actor;
    class B,D,F system;
    class C decision;
    class E risk;
    class F outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should let consumers unsubscribe from eligible email communications through a safe signed link.
* It should update the correct consumer communication preference.
* It should affect future campaign and scheduled communication sending where opt-out applies.

## How It Should Not Work

* It should not unsubscribe the wrong consumer.
* It should not accept tampered unsubscribe data.
* It should not ignore unsubscribe state in campaign or follow-up jobs.

## Developer Notes

* Unsubscribe is a public signed route that feeds communication delivery rules.
* Campaign and scheduled communication jobs must continue checking opt-out state.

## Related App Areas

* `routes/consumer/index.php`
* `app/Http/Controllers/Consumer/ConsumerUnsubscribeEmailController.php`
* `app/Jobs/SendSingleCampaignMessageJob.php`
* `app/Console/Commands/ProcessScheduledCommunicationsCommand.php`
