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

This commit is contained in:
lpsolit%gmail.com 2005-12-30 00:32:37 +00:00
Родитель ecde43e822
Коммит 2635bd319f
2 изменённых файлов: 15 добавлений и 13 удалений

Просмотреть файл

@ -977,7 +977,6 @@ sub notify {
my ($flag, $template_file) = @_; my ($flag, $template_file) = @_;
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {};
# There is nobody to notify. # There is nobody to notify.
return unless ($flag->{'addressee'} || $flag->{'type'}->{'cc_list'}); return unless ($flag->{'addressee'} || $flag->{'type'}->{'cc_list'});
@ -1007,17 +1006,21 @@ sub notify {
# If there is nobody left to notify, return. # If there is nobody left to notify, return.
return unless ($flag->{'addressee'} || $flag->{'type'}->{'cc_list'}); return unless ($flag->{'addressee'} || $flag->{'type'}->{'cc_list'});
$vars->{'flag'} = $flag; # Process and send notification for each recipient
foreach my $to ($flag->{'addressee'} ? $flag->{'addressee'}->email : '',
my $message; split(/[, ]+/, $flag->{'type'}->{'cc_list'}))
my $rv = {
$template->process($template_file, $vars, \$message); next unless $to;
if (!$rv) { my $vars = { 'flag' => $flag, 'to' => $to };
Bugzilla->cgi->header(); my $message;
ThrowTemplateError($template->error()); 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. # Cancel all request flags from the attachment being obsoleted.

Просмотреть файл

@ -38,8 +38,7 @@
[% subject_status = statuses.${flag.status} %] [% subject_status = statuses.${flag.status} %]
[% END %] [% END %]
From: bugzilla-request-daemon From: bugzilla-request-daemon
To: [% flag.addressee.email %] To: [% to %]
CC: [% flag.type.cc_list %]
Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ flag.target.bug.id %]] [% flag.target.bug.summary %] Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ flag.target.bug.id %]] [% flag.target.bug.summary %]
[%- IF flag.target.attachment.exists %] : [%- IF flag.target.attachment.exists %] :
[Attachment [% flag.target.attachment.id %]] [% flag.target.attachment.summary %][% END %] [Attachment [% flag.target.attachment.id %]] [% flag.target.attachment.summary %][% END %]