2022-07-25 19:31:54 -04:00
|
|
|
defmodule MemexWeb.EmailController do
|
2022-02-25 21:53:04 -05:00
|
|
|
@moduledoc """
|
|
|
|
A dev controller used to develop on emails
|
|
|
|
"""
|
|
|
|
|
2022-07-25 19:31:54 -04:00
|
|
|
use MemexWeb, :controller
|
|
|
|
alias Memex.Accounts.User
|
2022-02-25 21:53:04 -05:00
|
|
|
|
2022-07-25 19:31:54 -04:00
|
|
|
plug :put_layout, {MemexWeb.LayoutView, :email}
|
2022-02-25 21:53:04 -05:00
|
|
|
|
|
|
|
@sample_assigns %{
|
|
|
|
email: %{subject: "Example subject"},
|
2022-07-25 19:31:54 -04:00
|
|
|
url: "https://memex.bubbletea.dev/sample_url",
|
2022-02-25 21:53:04 -05:00
|
|
|
user: %User{email: "sample@email.com"}
|
|
|
|
}
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
Debug route used to preview emails
|
|
|
|
"""
|
|
|
|
def preview(conn, %{"id" => template}) do
|
|
|
|
render(conn, "#{template |> to_string()}.html", @sample_assigns)
|
|
|
|
end
|
|
|
|
end
|