From c9c4a62258de4284df5a536b51f062b306a3c774 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Thu, 8 Jun 2006 03:47:19 +0000 Subject: Bug 275638: Templatise 'whinemail' email - Patch by Emmanuel Seyman r=LpSolit a=myk --- whineatnews.pl | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'whineatnews.pl') diff --git a/whineatnews.pl b/whineatnews.pl index c3f0a7677..b05c19da0 100755 --- a/whineatnews.pl +++ b/whineatnews.pl @@ -68,20 +68,23 @@ foreach my $bug (@$slt_bugs) { } -my $template = Param('whinemail'); -my $urlbase = Param('urlbase'); -my $emailsuffix = Param('emailsuffix'); - foreach my $email (sort (keys %bugs)) { - my %substs; - $substs{'email'} = $email . $emailsuffix; - $substs{'userid'} = $email; - my $msg = perform_substs($template, \%substs); + my $vars = { + 'email' => $email + }; + my @bugs = (); foreach my $i (@{$bugs{$email}}) { - $msg .= " " . shift(@{$desc{$email}}) . "\n"; - $msg .= " -> ${urlbase}show_bug.cgi?id=$i\n"; + my $bug = {}; + $bug->{'summary'} = shift(@{$desc{$email}}); + $bug->{'id'} = $i; + push @bugs, $bug; } + $vars->{'bugs'} = \@bugs; + + my $msg; + my $template = Bugzilla->template; + $template->process("email/whine.txt.tmpl", $vars, \$msg); MessageToMTA($msg); -- cgit v1.2.3-24-g4f1b