fixed: no recipient if one of the members of the project has disabled mail notifications

git-svn-id: http://redmine.rubyforge.org/svn/trunk@145 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2007-01-03 18:26:45 +00:00
parent f3babef54a
commit e1ef9a5c72
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ class Mailer < ActionMailer::Base
def issue_add(issue) def issue_add(issue)
# Sends to all project members # Sends to all project members
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification } @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
@from = $RDM_MAIL_FROM @from = $RDM_MAIL_FROM
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}" @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
@body['issue'] = issue @body['issue'] = issue
@ -30,7 +30,7 @@ class Mailer < ActionMailer::Base
def issue_edit(journal) def issue_edit(journal)
# Sends to all project members # Sends to all project members
issue = journal.journalized issue = journal.journalized
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification } @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
@from = $RDM_MAIL_FROM @from = $RDM_MAIL_FROM
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}" @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
@body['issue'] = issue @body['issue'] = issue