# `PhoenixKit.Modules.Emails.BrevoIntegrations`
[🔗](https://github.com/BeamLabEU/phoenix_kit_emails/blob/0.4.2/lib/phoenix_kit/modules/emails/brevo_integrations.ex#L1)

Shared "which Brevo account(s) are actually active" resolution, used by
everything that needs to reach the Brevo events API on behalf of the
currently-configured sender(s): `BrevoPollingJob` (the background
poll), `BrevoOnDemandSync` (the "sync now" button), and the "Brevo
Events" settings section's per-account opt-out list.

"Active" means an *enabled* `PhoenixKit.Email.SendProfile` pointed at
a `"brevo_api"` integration — the same sender-aware definition
`BrevoPollingJob`'s moduledoc documents.

# `active_integration_uuids`

```elixir
@spec active_integration_uuids() :: [String.t()]
```

Every distinct `integration_uuid` referenced by an enabled `brevo_api`
SendProfile. Multiple profiles can share one integration/API key —
deduplicated so callers don't fetch the same account twice.

# `active_integrations_with_names`

```elixir
@spec active_integrations_with_names() :: [{String.t(), String.t()}]
```

`{integration_uuid, name}` pairs for every account
`active_integration_uuids/0` would poll — for the settings UI's
per-account opt-out list, which needs a human-readable name alongside
the uuid it writes to the exclusion setting.

# `resolve_api_key`

```elixir
@spec resolve_api_key(String.t()) :: {:ok, String.t()} | {:error, term()}
```

Resolves the decrypted `api_key` for a Brevo integration.

---

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