1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-25 01:12:30 +00:00
mobilizon/lib/web/email/email.ex

25 lines
612 B
Elixir
Raw Normal View History

2020-01-26 20:36:50 +00:00
defmodule Mobilizon.Web.Email do
2019-09-17 00:45:32 +00:00
@moduledoc """
The Email context.
"""
2020-01-26 20:36:50 +00:00
use Bamboo.Phoenix, view: Mobilizon.Web.EmailView
2019-09-17 00:45:32 +00:00
alias Mobilizon.Config
alias Mobilizon.Web.EmailView
@spec base_email(keyword()) :: Bamboo.Email.t()
def base_email(args) do
instance = Config.instance_config()
args
|> new_email()
|> from({Config.instance_name(), Config.instance_email_from()})
|> put_header("Reply-To", Config.instance_email_reply_to())
|> assign(:instance, instance)
|> put_html_layout({EmailView, "email.html"})
|> put_text_layout({EmailView, "email.text"})
2019-09-17 00:45:32 +00:00
end
end