From: lpsolit%gmail.com <> Date: Fri, 30 Dec 2005 08:34:50 +0000 (+0000) Subject: Bug 284590: When using SMTP, emails are not sent to the CC list associated with the... X-Git-Tag: bugzilla-2.20.1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6fa277fde01176984139ac4e3b6fe7f12ba103b;p=thirdparty%2Fbugzilla.git Bug 284590: When using SMTP, emails are not sent to the CC list associated with the flag type - Patch by Teemu Mannermaa r=wicked a=justdave --- diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 760731b281..643c6635b6 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -966,15 +966,21 @@ sub notify { $::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 $message; + $::vars->{'to'} = $to; + 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 9c3be33875..6e92c72ca3 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 %]