From fd2839c833b696c3a4d0a7c47d31367bcf71674f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 15 Jul 2007 11:12:08 +0000 Subject: [PATCH] Now, when a user turns mail notifications off, he will still receive notifications about issue changes if he is the author or the assignee of the issue. git-svn-id: http://redmine.rubyforge.org/svn/trunk@590 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mailer.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 62d5c163..bd4b6b7e 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -30,6 +30,11 @@ class Mailer < ActionMailer::Base set_language_if_valid(Setting.default_language) # Sends to all project members @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact + # Sends to author and assignee (even if they turned off mail notification) + @recipients << issue.author.mail + @recipients << issue.assigned_to.mail + @recipients.compact! + @recipients.uniq! @from = Setting.mail_from @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}" @body['issue'] = issue @@ -39,7 +44,12 @@ class Mailer < ActionMailer::Base set_language_if_valid(Setting.default_language) # Sends to all project members issue = journal.journalized - @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact + @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification } + # Sends to author and assignee (even if they turned off mail notification) + @recipients << issue.author.mail + @recipients << issue.assigned_to.mail + @recipients.compact! + @recipients.uniq! # Watchers in cc @cc = issue.watcher_recipients - @recipients @from = Setting.mail_from