View Source Swoosh.Adapter behaviour (Swoosh v1.16.4)

Specification of the email delivery adapter.

Summary

Callbacks

Delivers an email with the given config.

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.

Types

Callbacks

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

Delivers an email with the given config.

Link to this callback

deliver_many(list, config)

View Source (optional)
@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.

@callback validate_config(config()) :: :ok | no_return()
Link to this callback

validate_dependency()

View Source (optional)
@callback validate_dependency() :: :ok | [module() | {atom(), module()}]

Functions

Link to this function

validate_config(required_config, config)

View Source
@spec validate_config([atom()], Keyword.t()) :: :ok | no_return()
Link to this function

validate_dependency(required_deps)

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