about summary refs log tree commit diff
path: root/app/views/user_mailer
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-03-19 20:07:47 +0100
committerEugen Rochko <eugen@zeonfederated.com>2018-03-19 20:07:47 +0100
commit357f9298bdb595f67b1f89292be9fa4268e1bffd (patch)
treee3ef3cc9702492d68eee2b373f697b1651505084 /app/views/user_mailer
parentf7c46fc1138ff573c482e0c3059a2e7be43ef07e (diff)
Fix e-mail changed notification (fixes #6778) (#6835)
In Devise::Mailer#email_changed, the new email might be in the email attr.
See: https://github.com/plataformatec/devise/blob/master/app/views/devise/mailer/email_changed.html.erb
Diffstat (limited to 'app/views/user_mailer')
-rw-r--r--app/views/user_mailer/email_changed.html.haml2
-rw-r--r--app/views/user_mailer/email_changed.text.erb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/user_mailer/email_changed.html.haml b/app/views/user_mailer/email_changed.html.haml
index 7e82f23e4..0802aaf96 100644
--- a/app/views/user_mailer/email_changed.html.haml
+++ b/app/views/user_mailer/email_changed.html.haml
@@ -38,7 +38,7 @@
                           %table.input{ align: 'center', cellspacing: 0, cellpadding: 0 }
                             %tbody
                               %tr
-                                %td= @resource.unconfirmed_email
+                                %td= @resource.try(:unconfirmed_email) ? @resource.unconfirmed_email : @resource.email
 
 %table.email-table{ cellspacing: 0, cellpadding: 0 }
   %tbody
diff --git a/app/views/user_mailer/email_changed.text.erb b/app/views/user_mailer/email_changed.text.erb
index 2b58415f5..345b16a2c 100644
--- a/app/views/user_mailer/email_changed.text.erb
+++ b/app/views/user_mailer/email_changed.text.erb
@@ -4,6 +4,6 @@
 
 <%= t 'devise.mailer.email_changed.explanation' %>
 
-<%= @resource.unconfirmed_email %>
+<%= @resource.try(:unconfirmed_email) ? @resource.unconfirmed_email : @resource.email %>
 
 <%= t 'devise.mailer.email_changed.extra' %>