Send HTML emails

master
Marcin Kulik 7 years ago
parent a96e8518bc
commit a9f443766e

@ -7,6 +7,7 @@ defmodule Asciinema.Email do
|> to(email_address)
|> subject("Welcome to #{instance_hostname()}")
|> render("signup.text", signup_url: signup_url)
|> render("signup.html", signup_url: signup_url)
end
def login_email(email_address, login_url) do
@ -14,12 +15,14 @@ defmodule Asciinema.Email do
|> to(email_address)
|> subject("Login request")
|> render("login.text", login_url: login_url)
|> render("login.html", login_url: login_url)
end
defp base_email do
new_email()
|> from({"asciinema", from_address()})
|> put_header("Reply-To", reply_to_address())
|> put_html_layout({AsciinemaWeb.LayoutView, "email.html"})
end
defp from_address do

@ -0,0 +1,10 @@
<p>Hello,</p>
<p>Click the following link to log in to asciinema.org:</p>
<p><a href="<%= @login_url %>"><%= @login_url %></a></p>
<p>
<br>
If you did not initiate this request, just ignore this email. The request will expire shortly.
</p>

@ -0,0 +1,10 @@
<p>Welcome,</p>
<p>Click the following link to create your account at asciinema.org:</p>
<p><a href="<%= @signup_url %>"><%= @signup_url %></a></p>
<p>
<br>
If you did not initiate this request, just ignore this email. The request will expire shortly.
</p>

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<%= render @view_module, @view_template, assigns %>
</body>
</html>
Loading…
Cancel
Save