about summary refs log tree commit diff
path: root/app/mailers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-23 00:43:03 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-23 00:43:03 +0100
commitb191afcb5bb19e11b340a5092b3205ac67b4e4a7 (patch)
tree33636786a92b879cee5841f37bcb5b40e4761c0f /app/mailers
parentde9b6e3a6a8b62ffc2219d980f6ac4fea3f005d7 (diff)
Fix confirmation email being sent to old address when changing it
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/user_mailer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb
index e3ca39b3a..3b4d4d076 100644
--- a/app/mailers/user_mailer.rb
+++ b/app/mailers/user_mailer.rb
@@ -9,7 +9,7 @@ class UserMailer < Devise::Mailer
     @token    = token
 
     I18n.with_locale(@resource.locale || I18n.default_locale) do
-      mail to: @resource.email
+      mail to: @resource.unconfirmed_email.blank? ? @resource.email : @resource.unconfirmed_email
     end
   end