Commit fd2839c8 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Now, when a user turns mail notifications off, he will still receive…

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
parent 1cb5fc74
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment