diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index b97b0518e..00b41ed91 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -4,7 +4,8 @@ class UserMailer < ApplicationMailer # The email sent when a user receives a DMail. def dmail_notice(dmail) @dmail = dmail - mail(dmail.to, require_verified_email: true, subject: "#{Danbooru.config.app_name} - Message received from #{dmail.from.name}") + @user = dmail.to + mail(@user, require_verified_email: true, subject: "#{Danbooru.config.app_name}: #{dmail.from.name} sent you a message") end # The email sent when a user requests a password reset. diff --git a/app/views/layouts/user_mailer.html.erb b/app/views/layouts/user_mailer.html.erb new file mode 100644 index 000000000..87940b7bf --- /dev/null +++ b/app/views/layouts/user_mailer.html.erb @@ -0,0 +1,55 @@ + + +
+ + + ++ <%= link_to image_tag(image_url("/images/danbooru-logo-96x96.png", host: root_url), width: 16, height: 16, style: "vertical-align: middle"), root_url %> + <%= link_to Danbooru.config.canonical_app_name, root_url %> / + <%= link_to "Privacy", privacy_policy_url %> / + <%= link_to "Contact", contact_url %> + <% if content_for(:footer_links).present? %> + <%= yield :footer_links %> + <% end %> +
+<%= @dmail.from.name %> said:
+Hi <%= link_to_user @user %>,
+ +<%= link_to_user @dmail.from %> sent you a message on <%= link_to Danbooru.config.canonical_app_name, root_url %>:
+ +<%= link_to "View message", dmail_url(@dmail) %> | <%= link_to "Disable notifications", disable_email_notifications_url(@dmail.to) %>
- - +<%= link_to "Reply", new_dmail_url(respond_to_id: @dmail) %> | +<%= link_to "View message", dmail_url(@dmail) %> + ++ You received this email because you chose to receive notifications whenever someone sends you a message on <%= Danbooru.config.canonical_app_name %>. + <%= link_to "Click here", disable_email_notifications_url(@user) %> to unsubscribe from these emails. +
+ +<% content_for(:footer_links) do %> + / <%= link_to "Unsubscribe", disable_email_notifications_url(@user) %> +<% end %> diff --git a/app/views/user_mailer/email_change_confirmation.html.erb b/app/views/user_mailer/email_change_confirmation.html.erb index 148d89ef2..6391d5762 100644 --- a/app/views/user_mailer/email_change_confirmation.html.erb +++ b/app/views/user_mailer/email_change_confirmation.html.erb @@ -1,20 +1,15 @@ - - - -- You recently changed your email address on <%= Danbooru.config.app_name %>. - Click the link below to verify your new email address. -
++ You changed your email address on <%= link_to Danbooru.config.canonical_app_name, root_url %>. + Click the link below to verify your new email address: +
-- <%= link_to "Verify email address", email_verification_url(@user) %> -
++ <%= link_to "Verify email address", email_verification_url(@user) %> +
-- If you did not recently change your email address on <%= Danbooru.config.app_name %>, - you may delete and ignore this email. -
- - ++ You received this email because someone changed their email to this address on <%= link_to Danbooru.config.canonical_app_name, root_url %>. If this + wasn't you, you may ignore this email. +
diff --git a/app/views/user_mailer/password_reset.html.erb b/app/views/user_mailer/password_reset.html.erb index a91585375..68ea5b6d7 100644 --- a/app/views/user_mailer/password_reset.html.erb +++ b/app/views/user_mailer/password_reset.html.erb @@ -1,19 +1,15 @@ - - - -- You recently requested your <%= Danbooru.config.app_name %> password to be reset. - Click the link below to login to <%= Danbooru.config.app_name %> and reset your password. -
+- <%= link_to "Reset password", edit_user_password_url(@user, signed_user_id: Danbooru::MessageVerifier.new(:login).generate(@user.id, expires_in: 30.minutes)) %> -
++ You requested your <%= link_to Danbooru.config.canonical_app_name, root_url %> password to be reset. + Click the link below to reset your password: +
-- If you did not request for your <%= Danbooru.config.app_name %> password to - be reset, please ignore this email or reply to let us know. This link - will only be valid for the next 30 minutes. -
- - ++ <%= link_to "Reset password", edit_user_password_url(@user, signed_user_id: Danbooru::MessageVerifier.new(:login).generate(@user.id, expires_in: 30.minutes)) %> +
+ +
+ You received this email because someone requested a password reset for your account on <%= link_to Danbooru.config.canonical_app_name, root_url %>.
+ If this wasn't you, you may ignore this email. This link will expire in 30 minutes.
+
- Welcome to <%= Danbooru.config.app_name %>! Click the link below to verify your email address. -
++ Welcome to <%= link_to Danbooru.config.canonical_app_name, root_url %>! Click the link below to verify your email address: +
-- <%= link_to "Verify email address", email_verification_url(@user) %> -
++ <%= link_to "Verify email address", email_verification_url(@user) %> +
-- By verifying your email address, you can receive site notifications and you can - recover your account if you ever forget your password. -
- - ++ You received this email because someone signed up for <%= link_to Danbooru.config.canonical_app_name, root_url %> with your address. + <%= link_to "Click here", disable_email_notifications_url(@user) %> to disable email notifications. +
+ +<% content_for(:footer_links) do %> + / <%= link_to "Unsubscribe", disable_email_notifications_url(@user) %> +<% end %>