Bamboo.EEx
adds EEx template support to Bamboo. Great for environments not using Phoenix.
defmodule MyApp.Email do
use Bamboo.EEx, path: "lib/my_app/views"
def text_and_html_email() do
new_email()
|> render_to_html("email.html.eex")
|> render_to_text("email.text.eex")
end
def email_with_assigns(user) do
new_email()
|> render_to_html("email.html.eex", user: user)
end
def email_with_already_assigned_user(user) do
new_email()
|> assign(:user, user)
|> render_to_html("email.html.eex")
end
end
Hex: https://hex.pm/packages/bamboo_eex
GitHub: https://github.com/sticksnleaves/bamboo_eex
Documentation: https://hexdocs.pm/bamboo_eex/api-reference.html