Packages

Adds helpful extras to Guardian like default mailer support, as well as out of the box controllers and routes

Current section

Files

Jump to
sentinel lib sentinel mailer welcome.ex
Raw

lib/sentinel/mailer/welcome.ex

defmodule Sentinel.Mailer.Welcome do
@moduledoc """
Responsible for the creation (and easy override) of the default welcome email
"""
import Bamboo.Email
import Bamboo.Phoenix
import Sentinel.Mailer
@doc """
Takes a user, and a confirmation token and returns an email. It does not send
the email
"""
def build(user, confirmation_token) do
user
|> base_email
|> assign(:user, user)
|> assign(:confirmation_token, confirmation_token)
|> subject("Hello #{user.email}")
|> render(:welcome)
end
end