# `Mailglass.Suppression`
[🔗](https://github.com/szTheory/mailglass/blob/v0.1.0/lib/mailglass/suppression.ex#L1)

Public preflight facade for suppression checks (SEND-04).

Thin wrapper over `Mailglass.SuppressionStore.check/2` configured via:

    config :mailglass, :suppression_store, Mailglass.SuppressionStore.Ecto  # default
    config :mailglass, :suppression_store, Mailglass.SuppressionStore.ETS   # test-speed

## Return shape

- `:ok` when the recipient is not suppressed
- `{:error, %Mailglass.SuppressedError{type: scope}}` on a suppression hit

## Telemetry

Single-emit `[:mailglass, :outbound, :suppression, :stop]` with:
- Measurements: `%{duration_us: integer()}`
- Metadata: `%{hit: boolean(), tenant_id: String.t()}`

**No PII** — neither address nor stream appears in metadata. Context
on the `%SuppressedError{}` carries `tenant_id` + `stream` only
(stream is enum-narrow, not recipient-identifying).

# `check_before_send`
*since 0.1.0* 

```elixir
@spec check_before_send(Mailglass.Message.t()) ::
  :ok | {:error, Mailglass.SuppressedError.t()}
```

Pre-send suppression check. Returns `:ok` when allowed, `{:error, %SuppressedError{}}` when blocked.

Extracts the primary recipient from `msg.swoosh_email.to` and delegates to the
configured `SuppressionStore` implementation.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
