diff options
author | flaburgan <flaburgan@geexxx.fr> | 2019-06-29 14:24:34 +0300 |
---|---|---|
committer | Benjamin Neff <benjamin@coding4coffee.ch> | 2021-10-25 02:58:47 +0300 |
commit | 5b3f75f0115392333f5c387860c1cf2fa4872b1a (patch) | |
tree | 0afb5ea35e452ede748af844aa206eb315ba5ce6 | |
parent | dc99f0f77a7d501905777ada47e30cafba4a6dbd (diff) |
Remind the username in the reset password e-mail
closes #8037
-rw-r--r-- | Changelog.md | 1 | ||||
-rw-r--r-- | app/views/devise/mailer/confirmation_instructions.markerb | 4 | ||||
-rw-r--r-- | app/views/devise/mailer/reset_password_instructions.markerb | 6 | ||||
-rw-r--r-- | app/views/devise/mailer/unlock_instructions.markerb | 4 | ||||
-rw-r--r-- | config/locales/devise/devise.en.yml | 5 | ||||
-rw-r--r-- | spec/workers/reset_password_spec.rb | 1 |
6 files changed, 13 insertions, 8 deletions
diff --git a/Changelog.md b/Changelog.md index c5ae97cfe..e754c03d9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -17,6 +17,7 @@ * Add support for footnotes in markdown [#8277](https://github.com/diaspora/diaspora/pull/8277) * Send `AccountMigration` if receiving message to a migrated account [#8288](https://github.com/diaspora/diaspora/pull/8288) * Add podmin mail address to the footer [#8242](https://github.com/diaspora/diaspora/pull/8242) +* Add username to password-reset mail [#8037](https://github.com/diaspora/diaspora/pull/8037) # 0.7.15.0 diff --git a/app/views/devise/mailer/confirmation_instructions.markerb b/app/views/devise/mailer/confirmation_instructions.markerb index 80b5f86a4..6e0211f1f 100644 --- a/app/views/devise/mailer/confirmation_instructions.markerb +++ b/app/views/devise/mailer/confirmation_instructions.markerb @@ -1,7 +1,7 @@ -<%= t('devise.mailer.welcome', :email => @resource.email) %> +<%= t('devise.mailer.welcome', username: @resource.username) %> <%= t('.you_can_confirm') %> [<%= t('.confirm') %>][1] -[1]: <%= confirmation_url(@resource, :confirmation_token => @token) %> +[1]: <%= confirmation_url(@resource, confirmation_token: @token) %> diff --git a/app/views/devise/mailer/reset_password_instructions.markerb b/app/views/devise/mailer/reset_password_instructions.markerb index 1fe10a09a..ac800dd25 100644 --- a/app/views/devise/mailer/reset_password_instructions.markerb +++ b/app/views/devise/mailer/reset_password_instructions.markerb @@ -1,10 +1,12 @@ -<%= t('devise.mailer.hello', :email => @resource.email) %> +<%= t('devise.mailer.hello', username: @resource.username) %> <%= t('.someone_requested') %> [<%= t('.change') %>][1] -[1]: <%= edit_password_url(@resource, :reset_password_token => @token) %> +[1]: <%= edit_password_url(@resource, reset_password_token: @token) %> + +<%= t('.then_connect', username: @resource.username) %> <%= t('.wont_change') %> diff --git a/app/views/devise/mailer/unlock_instructions.markerb b/app/views/devise/mailer/unlock_instructions.markerb index c70ce7abb..d207a1bb9 100644 --- a/app/views/devise/mailer/unlock_instructions.markerb +++ b/app/views/devise/mailer/unlock_instructions.markerb @@ -1,4 +1,4 @@ -<%= t('devise.mailer.hello', :email => @resource.email) %> +<%= t('devise.mailer.hello', username: @resource.username) %> <%= t('.account_locked') %> @@ -6,4 +6,4 @@ [<%= t('.unlock') %>][1] -[1]: <%= unlock_url(@resource, :unlock_token => @token) %> +[1]: <%= unlock_url(@resource, unlock_token: @token) %> diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml index 47f78cf2d..a7e466457 100644 --- a/config/locales/devise/devise.en.yml +++ b/config/locales/devise/devise.en.yml @@ -30,6 +30,7 @@ en: someone_requested: Someone has requested a link to change your password. If it was you, you can do this through the link below. change: Change my password + then_connect: After setting a new password, you will be able to sign into diaspora* again using your username "%{username}" and your new password wont_change: Your password won't change until you access the link above and create a new one. ignore: If you didn't request this, please ignore this email. @@ -41,8 +42,8 @@ en: unlock: Unlock my account password_change: subject: Password Changed - welcome: Welcome %{email}! - hello: Hello %{email}! + welcome: Welcome %{username}! + hello: Hello %{username}! inviter: has_invited_you: "%{name}" have_invited_you: "%{names} have invited you to join diaspora*" diff --git a/spec/workers/reset_password_spec.rb b/spec/workers/reset_password_spec.rb index c57cf52d3..6d1b7ca72 100644 --- a/spec/workers/reset_password_spec.rb +++ b/spec/workers/reset_password_spec.rb @@ -13,6 +13,7 @@ describe Workers::ResetPassword do mail = Devise.mailer.deliveries.last expect(mail.to).to eq([alice.email]) expect(mail.body).to include("change your password") + expect(mail.body).to include(alice.username) end end end |