ravenx_email v0.1.0 Ravenx.Strategy.Email View Source

Ravenx Email strategy.

Used to dispatch notifications via email.

Link to this section Summary

Functions

Function used to send a notification via email

Link to this section Functions

Link to this function available_adapters() View Source
available_adapters() :: keyword()
Link to this function call(payload, opts) View Source
call(map(), %{adapter: atom()}) ::
  {:ok, Bamboo.Email.t()} | {:error, {atom(), any()}}

Function used to send a notification via email.

It receives two maps, containing the payload and options.

The payload can include this keys:

  • from: (required) the email address from which the email is sent.
  • to: (required) a list of email addresses that will receive the email.
  • cc: a list of email addresses that will receive a copy of the email.
  • bcc: a list of email addresses that will receive a hidden copy of the email.
  • subject: the subject of the e-mail.
  • text_body: the text version of the message.
  • html_body: that HTML version of the message.

In the options map there must be an adapter key indicating one of the available adapters, and also the configuration required for each adapter.

It will respond with a tuple, indicating if everything is :ok or there was an :error.