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
This commit is contained in:
Jean-Philippe Lang 2007-07-15 11:12:08 +00:00
parent 1cb5fc747f
commit fd2839c833
1 changed files with 11 additions and 1 deletions

View File

@ -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