diff --git a/app/views/clearance_mailer/change_password.html.erb b/app/views/clearance_mailer/change_password.html.erb index ed01f74b5..bc315ecba 100644 --- a/app/views/clearance_mailer/change_password.html.erb +++ b/app/views/clearance_mailer/change_password.html.erb @@ -1,5 +1,8 @@ -<%= t(".opening") %> +

<%= t(".opening") %>

-<%= edit_user_password_url(@user, token: @user.confirmation_token.html_safe) %> +

+ <%= link_to t(".link_text", default: "Change my password"), + edit_user_password_url(@user, token: @user.confirmation_token.html_safe) %> +

-<%= raw t(".closing") %> +

<%= raw t(".closing") %>

diff --git a/config/locales/clearance.en.yml b/config/locales/clearance.en.yml index 89d160d3c..f246d468d 100644 --- a/config/locales/clearance.en.yml +++ b/config/locales/clearance.en.yml @@ -4,6 +4,7 @@ en: change_password: closing: If you didn't request this, ignore this email. Your password has not been changed. + link_text: Change my password opening: "Someone, hopefully you, requested we send you a link to change your password:" flashes: diff --git a/spec/mailers/clearance_mailer_spec.rb b/spec/mailers/clearance_mailer_spec.rb index 429478538..44d5d7b03 100644 --- a/spec/mailers/clearance_mailer_spec.rb +++ b/spec/mailers/clearance_mailer_spec.rb @@ -29,6 +29,9 @@ email = ClearanceMailer.change_password(user) expect(email.body.to_s).to include(link) + expect(email.body.to_s).to have_css( + "a", text: I18n.t("clearance_mailer.change_password.link_text") + ) end it "sets its subject" do