summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Flag.pm
diff options
context:
space:
mode:
authorEd Morley <emorley@mozilla.com>2015-03-19 08:16:30 +0100
committerByron Jones <glob@mozilla.com>2015-03-19 08:16:30 +0100
commit6638a015487885a47bb0ba851865ef8b073d08fb (patch)
tree114070587bef8d7eb8dbc1f833258adbcd73dafd /Bugzilla/Flag.pm
parent2f65ef51e9ba430783a2d9ef06e0aa0af041d510 (diff)
downloadbugzilla-6638a015487885a47bb0ba851865ef8b073d08fb.tar.gz
bugzilla-6638a015487885a47bb0ba851865ef8b073d08fb.tar.xz
Bug 1105568: Add support for HTML flagmail
r=glob,a=glob
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r--Bugzilla/Flag.pm27
1 files changed, 10 insertions, 17 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 50474b885..6d056e7e6 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -1116,13 +1116,6 @@ sub notify {
if ($addressee && $addressee->email_enabled) {
$recipients{$addressee->email} = $addressee;
}
- # Process and send notification for each recipient.
- # If there are users in the CC list who don't have an account,
- # use the default language for email notifications.
- my $default_lang;
- if (grep { !$_ } values %recipients) {
- $default_lang = Bugzilla::User->new()->setting('lang');
- }
# Get comments on the bug
my $all_comments = $bug->comments({ after => $bug->lastdiffed });
@@ -1132,18 +1125,20 @@ sub notify {
my $public_comments = [ grep { !$_->is_private } @$all_comments ];
foreach my $to (keys %recipients) {
+ my $user = $recipients{$to};
# Add threadingmarker to allow flag notification emails to be the
# threaded similar to normal bug change emails.
- my $thread_user_id = $recipients{$to} ? $recipients{$to}->id : 0;
+ my $thread_user_id = $user ? $user->id : 0;
# We only want to show private comments to users in the is_insider group
- my $comments = $recipients{$to} && $recipients{$to}->is_insider
+ my $comments = $user && $user->is_insider
? $all_comments : $public_comments;
my $vars = {
flag => $flag,
old_flag => $old_flag,
to => $to,
+ to_user => $user,
date => $timestamp,
bug => $bug,
attachment => $attachment,
@@ -1151,15 +1146,13 @@ sub notify {
new_comments => $comments,
};
- my $lang = $recipients{$to} ?
- $recipients{$to}->setting('lang') : $default_lang;
-
- my $template = Bugzilla->template_inner($lang);
- my $message;
- $template->process("email/flagmail.txt.tmpl", $vars, \$message)
- || ThrowTemplateError($template->error());
+ my $templates = {
+ header => "email/flagmail-header.txt.tmpl",
+ text => "email/flagmail.txt.tmpl",
+ html => "email/flagmail.html.tmpl",
+ };
- MessageToMTA($message);
+ MessageToMTA(generate_email($vars, $templates));
}
}