legendary-doc-site/apps/core/lib/core_email.ex

20 lines
554 B
Elixir
Raw Normal View History

defmodule Legendary.CoreEmail do
2020-07-10 19:39:38 +00:00
@moduledoc """
The core library for email in the application. The functions here can be composed in the application to send
different emails.
"""
import Bamboo.Email
use Bamboo.Phoenix, view: Legendary.CoreWeb.CoreEmailView
2020-07-10 19:39:38 +00:00
def base_email() do
new_email()
|> put_html_layout({Legendary.CoreWeb.CoreEmailView, "email.html"})
|> put_text_layout({Legendary.CoreWeb.CoreEmailView, "email.text"})
2020-07-10 19:39:38 +00:00
|> from(sender())
end
defp sender() do
Application.get_env(:core, :email_from)
end
end