diff options
author | lpsolit%gmail.com <> | 2005-12-30 09:32:36 +0100 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-12-30 09:32:36 +0100 |
commit | 4c12fe8d354b6c3361992bf4b965c5f54e6f2b2b (patch) | |
tree | 5e2f885765c81494df336411307466d35a522de2 | |
parent | 9d57a9189426bedff1ae122c5e4a1a7e06fed8c4 (diff) | |
download | bugzilla-4c12fe8d354b6c3361992bf4b965c5f54e6f2b2b.tar.gz bugzilla-4c12fe8d354b6c3361992bf4b965c5f54e6f2b2b.tar.xz |
Bug 284590: When using SMTP, emails are not sent to the CC list associated with the flag type - Patch by Teemu Mannermaa <wicked@etlicon.fi> r=wicked a=justdave
-rw-r--r-- | Bugzilla/Flag.pm | 25 | ||||
-rw-r--r-- | template/en/default/request/email.txt.tmpl | 3 |
2 files changed, 15 insertions, 13 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index b4c1bc595..7b074887a 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -977,7 +977,6 @@ sub notify { my ($flag, $template_file) = @_; my $template = Bugzilla->template; - my $vars = {}; # There is nobody to notify. return unless ($flag->{'addressee'} || $flag->{'type'}->{'cc_list'}); @@ -1007,17 +1006,21 @@ sub notify { # If there is nobody left to notify, return. return unless ($flag->{'addressee'} || $flag->{'type'}->{'cc_list'}); - $vars->{'flag'} = $flag; - - my $message; - my $rv = - $template->process($template_file, $vars, \$message); - if (!$rv) { - Bugzilla->cgi->header(); - ThrowTemplateError($template->error()); - } + # Process and send notification for each recipient + foreach my $to ($flag->{'addressee'} ? $flag->{'addressee'}->email : '', + split(/[, ]+/, $flag->{'type'}->{'cc_list'})) + { + next unless $to; + my $vars = { 'flag' => $flag, 'to' => $to }; + my $message; + my $rv = $template->process($template_file, $vars, \$message); + if (!$rv) { + Bugzilla->cgi->header(); + ThrowTemplateError($template->error()); + } - Bugzilla::BugMail::MessageToMTA($message); + Bugzilla::BugMail::MessageToMTA($message); + } } # Cancel all request flags from the attachment being obsoleted. diff --git a/template/en/default/request/email.txt.tmpl b/template/en/default/request/email.txt.tmpl index 9c3be3387..6e92c72ca 100644 --- a/template/en/default/request/email.txt.tmpl +++ b/template/en/default/request/email.txt.tmpl @@ -38,8 +38,7 @@ [% subject_status = statuses.${flag.status} %] [% END %] From: bugzilla-request-daemon -To: [% flag.addressee.email %] -CC: [% flag.type.cc_list %] +To: [% to %] Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ flag.target.bug.id %]] [% flag.target.bug.summary %] [%- IF flag.target.attachment.exists %] : [Attachment [% flag.target.attachment.id %]] [% flag.target.attachment.summary %][% END %] |