From 33a9e1eaa9a9613a549ceea8b196ea80ed50e09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 25 May 2023 16:56:40 +0200 Subject: [PATCH] Use username instead of email in Devise mails --- app/views/devise/mailer/confirmation_instructions.html.erb | 4 ++-- app/views/devise/mailer/email_changed.html.erb | 2 +- app/views/devise/mailer/password_change.html.erb | 2 +- app/views/devise/mailer/reset_password_instructions.html.erb | 2 +- app/views/devise/mailer/unlock_instructions.html.erb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index dc55f64..7cfe815 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -1,5 +1,5 @@ -

Welcome <%= @email %>!

+

Welcome <%= @resource.cn %>!

-

You can confirm your account email through the link below:

+

Please confirm your email address through the link below:

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/email_changed.html.erb b/app/views/devise/mailer/email_changed.html.erb index 32f4ba8..26ac013 100644 --- a/app/views/devise/mailer/email_changed.html.erb +++ b/app/views/devise/mailer/email_changed.html.erb @@ -1,4 +1,4 @@ -

Hello <%= @email %>!

+

Hello <%= @resource.cn %>!

<% if @resource.try(:unconfirmed_email?) %>

We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.

diff --git a/app/views/devise/mailer/password_change.html.erb b/app/views/devise/mailer/password_change.html.erb index b41daf4..4793cbe 100644 --- a/app/views/devise/mailer/password_change.html.erb +++ b/app/views/devise/mailer/password_change.html.erb @@ -1,3 +1,3 @@ -

Hello <%= @resource.email %>!

+

Hello <%= @resource.cn %>!

We're contacting you to notify you that your password has been changed.

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb index f667dc1..d10b9dc 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -1,4 +1,4 @@ -

Hello <%= @resource.email %>!

+

Hello <%= @resource.cn %>!

Someone has requested a link to change your password. You can do this through the link below.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb index 41e148b..c216377 100644 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -1,4 +1,4 @@ -

Hello <%= @resource.email %>!

+

Hello <%= @resource.cn %>!

Your account has been locked due to an excessive number of unsuccessful sign in attempts.