1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-27 02:10:27 +00:00
mobilizon/lib/mobilizon_web/email/email.ex
Thomas Citharel b6645a4acc
Include sender mail in from: emails
Closes #277

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-11-19 11:12:59 +01:00

22 lines
603 B
Elixir

defmodule MobilizonWeb.Email do
@moduledoc """
The Email context.
"""
use Bamboo.Phoenix, view: MobilizonWeb.EmailView
alias Mobilizon.Config
@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({MobilizonWeb.EmailView, "email.html"})
|> put_text_layout({MobilizonWeb.EmailView, "email.text"})
end
end