emails: send verification mail when user changes address.

This commit is contained in:
evazion
2020-03-14 18:32:00 -05:00
parent 167fe51a8a
commit d860fab7f5
7 changed files with 61 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
<!doctype html>
<html>
<body>
<h2>Hi <%= @user.name %>,</h2>
<p>
You recently changed your email address on <%= Danbooru.config.app_name %>.
Click the link below to verify your new email address.
</p>
<p>
<%= link_to "Verify email address", verify_user_email_url(@user, email_verification_key: Danbooru::MessageVerifier.new(:email_verification_key).generate(@user.email_address.id)) %>
</p>
<p>
If you did not recently change your email address on <%= Danbooru.config.app_name %>,
you may delete and ignore this email.
</p>
</body>
</html>

View File

@@ -27,6 +27,9 @@
<p>
<% if @user.email_address.present? %>
<%= @user.email_address.address %>
<% if !@user.email_address.is_verified %>
<em>(unverified)</em>
<% end %>
<% else %>
<em>blank</em>
<% end %>