# `Swoosh.Adapter`
[🔗](https://github.com/swoosh/swoosh/blob/v1.25.0/lib/swoosh/adapter.ex#L1)

Specification of the email delivery adapter.

# `config`

```elixir
@type config() :: Keyword.t()
```

# `email`

```elixir
@type email() :: Swoosh.Email.t()
```

# `t`

```elixir
@type t() :: module()
```

# `deliver`

```elixir
@callback deliver(email(), config()) :: {:ok, term()} | {:error, term()}
```

Delivers an email with the given config.

# `deliver_many`
*optional* 

```elixir
@callback deliver_many([email()], config()) :: {:ok, [term()]} | {:error, term()}
```

Delivers multiple emails with the given config in one request. Some email providers allow multiple
messages to be sent in one HTTP request, for example Mailjet and Postmark allow this. Check your
provider's documentation to see if that is possible, and see the adapter you use to find out whether
it has been implemented.

# `validate_config`

```elixir
@callback validate_config(config()) :: :ok | no_return()
```

# `validate_dependency`
*optional* 

```elixir
@callback validate_dependency() :: :ok | [module() | {atom(), module()}]
```

# `validate_config`

```elixir
@spec validate_config([atom()], Keyword.t()) :: :ok | no_return()
```

# `validate_dependency`

```elixir
@spec validate_dependency([module() | {atom(), module()}]) ::
  :ok | {:error, [module() | {:atom | module()}]}
```

---

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