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