diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 459dcab5a..381151de5 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -31,12 +31,12 @@ class UserMailer < ActionMailer::Base end end - def new_issue_notification(issue, user) - @user, @issue = user, issue + def new_issue_notification(issue_id, user_id) + @user, @issue = User.find(user_id), Issue.find(issue_id) mail( - to: email_with_name(user, user.email), - subject: subject_for_issue(issue, true), - from: email_with_name(issue.user) + to: email_with_name(@user, @user.email), + subject: subject_for_issue(@issue, true), + from: email_with_name(@issue.user) ) do |format| format.html end diff --git a/app/models/concerns/feed/issue.rb b/app/models/concerns/feed/issue.rb index 5d18f8f35..f57f0fce0 100644 --- a/app/models/concerns/feed/issue.rb +++ b/app/models/concerns/feed/issue.rb @@ -17,7 +17,7 @@ module Feed::Issue collect_recipients.each do |recipient| next if user_id == recipient.id if recipient.notifier.can_notify && recipient.notifier.new_issue && assignee_id != recipient.id - UserMailer.new_issue_notification(self, recipient).deliver + UserMailer.new_issue_notification(id, recipient.id).deliver end ActivityFeed.create( user: recipient,