Skip to content

Commit

Permalink
Issue #2955 - UserMailer#permissions_change_notification receives inc…
Browse files Browse the repository at this point in the history
…orrect user

Changes:
 - Added an instance variable @recepient = @role.user to
permissions_change_notification() method in roles_controller and removed
instance variable @username and replaced @role.user.email by
@recepient.email.
 - Replaced username with recepientname = @recepient.name in permissions_change_notification.html.erb
  • Loading branch information
John Pinto committed Oct 25, 2021
1 parent 497229a commit 7e7e558
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ def permissions_change_notification(role, user)
@role = role
@plan_title = @role.plan.title
@user = user
@username = @user.name
@recepient = @role.user
@messaging = role_text(@role)

I18n.with_locale I18n.default_locale do
mail(to: @role.user.email,
mail(to: @recepient.email,
subject: _("Changed permissions on a Data Management Plan in %{tool_name}") %
{
tool_name: tool_name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>
<%= _('Hello %{username}') %{ username: @username } %>
<%= _('Hello %{recepientname}') %{ recepientname: @recepient.name } %>
</p>
<p>
<%= _('Your permissions relating to %{plan_title} have changed. You now have %{type} access. This means you can %{placeholder1} %{placeholder2}') % {
Expand Down

0 comments on commit 7e7e558

Please sign in to comment.