2021-03-19 19:32:18 +00:00
|
|
|
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
|
2021-03-19 19:32:18 +00:00
|
|
|
use Bamboo.Phoenix, view: Legendary.CoreWeb.CoreEmailView
|
2020-07-10 19:39:38 +00:00
|
|
|
|
|
|
|
def base_email() do
|
|
|
|
new_email()
|
2021-03-19 19:32:18 +00:00
|
|
|
|> 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
|