diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml index 8e10475a1..42250d7b9 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -1,8 +1,5 @@ - site_name = Growstuff::Application.config.site_name -%p - Welcome, - = @resource.login_name - ! +%p Hello #{@resource.login_name}, %p Your account on #{site_name} has been created. You just need to confirm diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 9e8fc5534..13f3a123a 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -1,12 +1,19 @@ -%p - Hello - = @resource.email - ! +- site_name = Growstuff::Application.config.site_name +%p Hello #{@resource.login_name}, -%p Someone has requested a link to change your password, and you can do this through the link below. +%p Someone has requested a link to reset your password on #{site_name}. +We presume this was you, in which case you can do so through this link: %p = link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) -%p If you didn't request this, please ignore this email. -%p Your password won't change until you access the link above and create a new one. +%p If it wasn't you, then someone's made a typo or has been messing +around. In this case, you can safely ignore this email, and your +password will not be changed. + +%p See you soon, + +%p The #{site_name} team. +%br/ +=link_to root_url, root_url + diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 2b5c49d16..7c25dce77 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -1,13 +1,20 @@ -%p - Hello - = @resource.email - ! +- site_name = Growstuff::Application.config.site_name +%p Hello #{@resource.login_name}, %p - Your account has been locked due to an excessive amount of unsuccessful sign - in attempts. + Your #{site_name} account has been locked due to an excessive number + of unsuccessful sign in attempts. We do this in case someone's trying + to break into your account, but it might also mean you've just + forgotten your password. In either case, use the link below to unlock + your account: -%p Click the link below to unlock your account: +%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) -%p - = link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) +%p If you have actually forgotten your password, you can += link_to 'reset your password', new_password_url(@resource) +after you've unlocked your account. + +%p See you soon, +%p The #{site_name} team. +%br/ +=link_to root_url, root_url diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index fada677b5..55bbf9e81 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -58,6 +58,6 @@ en: confirmation_instructions: subject: 'Welcome to Growstuff. Please confirm your account.' reset_password_instructions: - subject: 'Reset password instructions' + subject: 'Growstuff password reset instructions' unlock_instructions: - subject: 'Unlock Instructions' + subject: 'Unlock your Growstuff account' diff --git a/spec/views/devise/mailer/reset_password_instructions_spec.rb b/spec/views/devise/mailer/reset_password_instructions_spec.rb index f1eb0bc79..4f19281a3 100644 --- a/spec/views/devise/mailer/reset_password_instructions_spec.rb +++ b/spec/views/devise/mailer/reset_password_instructions_spec.rb @@ -12,7 +12,7 @@ describe 'devise/mailer/reset_password_instructions.html.haml', :type => "view" it 'should have some of the right text' do rendered.should contain 'Change my password' - rendered.should contain 'please ignore this email' + rendered.should contain 'Someone has requested a link to reset your password' end end end diff --git a/spec/views/devise/mailer/unlock_instructions_spec.rb b/spec/views/devise/mailer/unlock_instructions_spec.rb index 04e2922ca..eab417fae 100644 --- a/spec/views/devise/mailer/unlock_instructions_spec.rb +++ b/spec/views/devise/mailer/unlock_instructions_spec.rb @@ -1,14 +1,16 @@ +require 'spec_helper' describe 'devise/mailer/unlock_instructions.html.haml', :type => "view" do context "logged in" do before(:each) do - @resource = mock_model(Member) +#@resource = mock_model(Member) + @resource = FactoryGirl.create(:member) @resource.should_receive(:email).and_return("example@example.com") @resource.should_receive(:unlock_token).and_return("fred") render end it "should explain what's happened" do - rendered.should contain "Your account has been locked" + rendered.should contain "account has been locked" end it "should have an unlock link" do