helf v0.0.1 HELF.Mailer
Provides a way for sending emails with a list of Bamboo mailers.
It will try to send the email using the first available mailer, and then fallback to the next whenever the current one fails.
Before using the module, you should configure the list of mailers, this is what it should looks like:
config :helf, HELF.Mailer,
mailers: [HELM.Mailer.MailGun, HELM.Mailer.Maldrill],
default_sender: "sender@config.com"
The default sender is completely optional.
Link to this section Summary
Functions
Awaits until email is sent, will raise RuntimeError
on timeout
Sets the email sender
Sets the html body of the email
Creates a new empty email, see new/1 for composing emails using the params
Creates and composes a new email using the params
Sends the email
, optionally accepts a mailers
keyword
Sends the email
from another processs, optionally accepts notify
and
mailers
keywords
Sets the email subject
Sets the text body of the email
Sets the email recipient
Awaits until email is sent, yields nil
on timeout
Link to this section Types
Link to this section Functions
await(HELF.Mailer.AsyncEmail.t, timeout :: non_neg_integer) :: {:ok, HELF.Mailer.SentEmail.t} | {:error, email}
Awaits until email is sent, will raise RuntimeError
on timeout.
Sets the email sender.
Sets the html body of the email
.
Creates a new empty email, see new/1 for composing emails using the params.
Creates and composes a new email using the params.
send(email, params :: [{:mailers, [module, ...]}]) :: {:ok, HELF.Mailer.SentEmail.t} | {:error, email} | {:error, :internal_error}
Sends the email
, optionally accepts a mailers
keyword.
send_async(email, params :: [notify: boolean, mailers: [module, ...]]) :: HELF.Mailer.AsyncEmail.t
Sends the email
from another processs, optionally accepts notify
and
mailers
keywords.
To use await
and yield
methods, set the notify
keyword to true.
Sets the email subject.
Sets the text body of the email
.
Sets the email recipient.
yield(HELF.Mailer.AsyncEmail.t, timeout :: non_neg_integer) :: {:ok, HELF.Mailer.SentEmail.t} | {:error, email} | nil
Awaits until email is sent, yields nil
on timeout.