sentinel v2.0.0 Sentinel.Mailer

Provides mailer base imported into mailer modules

Examples

defmodule Sentinel.Mailer.NewEmailAddress do
  import Sentinel.Mailer

  def send(user, confirmation_token) do
    base_email(user)
    |> to(user.unconfirmed_email)
    |> subject("Please confirm your email address")
    |> assign(:user, user)
    |> assign(:confirmation_token, confirmation_token)
    |> render(:new_email_address)
  end
end

Summary

Functions

Retrives the app name used in emails sent

Provides base email that can be piped using functions described in the Bamboo module

Retrives the default application from tuple

Method used to send and manage delivery of emails, which references config ensuring user wants emails to go out in a given environment

Render an Phoenix template and set the body on the email

Retrives the default application reply to email

Retrives the default application email sender

Thin wrapper around the Sentinel.Mailer.Invite module

Thin wrapper around the Sentinel.Mailer.NewEmailAddress module

Thin wrapper around the Sentinel.Mailer.PasswordReset module

Thin wrapper around the Sentinel.Mailer.Welcome module

Functions

app_name()

Retrives the app name used in emails sent

base_email(user)

Provides base email that can be piped using functions described in the Bamboo module

deliver(email)
deliver_later(email)
deliver_later(Bamboo.Email.t) :: Bamboo.Email.t
deliver_now(email)
deliver_now(Bamboo.Email.t) :: Bamboo.Email.t
from()

Retrives the default application from tuple

managed_deliver(email)

Method used to send and manage delivery of emails, which references config ensuring user wants emails to go out in a given environment

render(email, template, assigns \\ [])

Render an Phoenix template and set the body on the email

Pass an atom as the template name (:welcome_email) to render HTML and plain text emails. Use a string if you only want to render one type, e.g. “welcome_email.text” or “welcome_email.html”. Scroll to the top for more examples.

reply_to()

Retrives the default application reply to email

send_address()

Retrives the default application email sender

send_invite_email(user, map)

Thin wrapper around the Sentinel.Mailer.Invite module

send_new_email_address_email(user, confirmation_token)

Thin wrapper around the Sentinel.Mailer.NewEmailAddress module

send_password_reset_email(user, password_reset_token)

Thin wrapper around the Sentinel.Mailer.PasswordReset module

send_welcome_email(user, confirmation_token)

Thin wrapper around the Sentinel.Mailer.Welcome module