##// END OF EJS Templates
fixed: no recipient if one of the members of the project has disabled mail notifications...
Jean-Philippe Lang -
r142:e1ef9a5c7214
parent child
Show More
@@ -1,53 +1,53
1 1 # redMine - project management software
2 2 # Copyright (C) 2006 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 class Mailer < ActionMailer::Base
19 19
20 20 helper IssuesHelper
21 21
22 22 def issue_add(issue)
23 23 # Sends to all project members
24 @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }
24 @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
25 25 @from = $RDM_MAIL_FROM
26 26 @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
27 27 @body['issue'] = issue
28 28 end
29 29
30 30 def issue_edit(journal)
31 31 # Sends to all project members
32 32 issue = journal.journalized
33 @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }
33 @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
34 34 @from = $RDM_MAIL_FROM
35 35 @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
36 36 @body['issue'] = issue
37 37 @body['journal']= journal
38 38 end
39 39
40 40 def lost_password(token)
41 41 @recipients = token.user.mail
42 42 @from = $RDM_MAIL_FROM
43 43 @subject = l(:mail_subject_lost_password)
44 44 @body['token'] = token
45 45 end
46 46
47 47 def register(token)
48 48 @recipients = token.user.mail
49 49 @from = $RDM_MAIL_FROM
50 50 @subject = l(:mail_subject_register)
51 51 @body['token'] = token
52 52 end
53 53 end
General Comments 0
You need to be logged in to leave comments. Login now