# `Swoosh.Adapters.Cloudflare`
[🔗](https://github.com/devaction-labs/swoosh_cloudflare/blob/v0.2.1/lib/swoosh_cloudflare/adapters/cloudflare.ex#L1)

Swoosh adapter for Cloudflare Email Service REST API.

## Configuration

    config :my_app, MyApp.Mailer,
      adapter: Swoosh.Adapters.Cloudflare,
      api_token: System.get_env("CLOUDFLARE_EMAIL_TOKEN"),
      account_id: System.get_env("CLOUDFLARE_ACCOUNT_ID")

## Success response

`deliver/2` returns `{:ok, %{delivered: [...], permanent_bounces: [...], queued: [...]}}`.

## Error responses

`deliver/2` returns `{:error, {status, reason}}` for most errors, and
`{:error, {429, :rate_limited, retry_after_seconds}}` for rate limiting,
where `retry_after_seconds` is an integer or `nil` if the header was absent.

## Limitations

- New accounts can only send to verified addresses. Paid plans unlock general sending.
- The `from` address must belong to a domain with Email Routing active in the Cloudflare account.
- Maximum 50 recipients per email (combined to/cc/bcc).
- Maximum message size: 5 MiB (25 MiB for verified accounts).
- Transactional email only — bulk/marketing sending is not supported.

# `validate_config`

# `validate_dependency`

---

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