summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-07-15 11:12:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-07-15 11:12:08 +0000
commitfd2839c833b696c3a4d0a7c47d31367bcf71674f (patch)
treec278da943a2b7924c30efb3099b81d5a2d3b0219
parent1cb5fc747f10a5e5c2698ac6f5637b9c447e6bdf (diff)
downloadredmine-fd2839c833b696c3a4d0a7c47d31367bcf71674f.tar.gz
redmine-fd2839c833b696c3a4d0a7c47d31367bcf71674f.zip
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
-rw-r--r--app/models/mailer.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 62d5c1635..bd4b6b7ea 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