diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 7da10e1e..17d6adbd 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -10,6 +10,7 @@ * Support alternate sign in error message when email record does not exist (@gabetax) * bug fix + * unconfirmed_email now uses the proper e-mail on salutation * Fix default email_regexp config to not allow spaces (by @kukula) * Fix a regression introduced on warden 1.2.1 (by @ejfinneran) * Properly camelize omniauth strategies (by @saizai) diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index a5c4585e..133fd723 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -1,4 +1,4 @@ -
Welcome <%= @resource.email %>!
+Welcome <%= @headers[:to] %>!
You can confirm your account email through the link below:
diff --git a/lib/devise/mailers/helpers.rb b/lib/devise/mailers/helpers.rb index 7d1b92e2..ee3c7c1b 100644 --- a/lib/devise/mailers/helpers.rb +++ b/lib/devise/mailers/helpers.rb @@ -38,7 +38,7 @@ module Devise headers.merge!(resource.headers_for(action)) end - headers + @headers = headers end def mailer_reply_to(mapping) diff --git a/lib/generators/templates/markerb/confirmation_instructions.markerb b/lib/generators/templates/markerb/confirmation_instructions.markerb index 84665383..621add1d 100644 --- a/lib/generators/templates/markerb/confirmation_instructions.markerb +++ b/lib/generators/templates/markerb/confirmation_instructions.markerb @@ -1,4 +1,4 @@ -Welcome <%= @resource.email %>! +Welcome <%= @headers[:to] %>! You can confirm your account through the link below: diff --git a/test/models/confirmable_test.rb b/test/models/confirmable_test.rb index 3d93d6db..74df0b37 100644 --- a/test/models/confirmable_test.rb +++ b/test/models/confirmable_test.rb @@ -294,7 +294,6 @@ class ReconfirmableTest < ActiveSupport::TestCase assert_nil admin.confirmation_token end - test 'should regenerate confirmation token after changing email' do admin = create_admin assert admin.confirm! @@ -310,6 +309,7 @@ class ReconfirmableTest < ActiveSupport::TestCase assert_email_sent "new_test@example.com" do assert admin.update_attributes(:email => 'new_test@example.com') end + assert_match "new_test@example.com", ActionMailer::Base.deliveries.last.body.encoded end test 'should not send confirmation by email after changing password' do