Email Templating
AccessPass sends 3 different type of emails for you. Confirmation email after a new user registration, password reset email and forgot username email. Out of the box is uses a very basic html for each.
AccessPass allows you to override each of those emails by using the AccessPassBehavior. Look at the AccessPassBehavior module docs for more details.
The html returned by your functions will go through EEx to swap for needed information. Below will show you the required EEx keys.
confirmation template
required: <%= conf_key %>
optional: <%= base_url %>
example:
defmodule Test.Temps
use AccessPassBehavior
def confirmation_email() do
"""
<a href="https://<%= base_url %>?con_key=<%= conf_key %>"></a>
"""
end
end
password reset template
required: <%= password_key %>
optional: <%= base_url %>
example:
defmodule Test.Temps
use AccessPassBehavior
def password_reset() do
"""
<a href="https://<%= base_url %>/reset?con_key=<%= password_key %>"></a>
"""
end
end
forgot username template
required: <%= user_name %>
example:
defmodule Test.Temps
use AccessPassBehavior
def forgot_username() do
"""
<h1> Your username is <%= user_name %>!</h1>
"""
end
end