From c8458af4ba895a5614c44fe9f85795f2142efb5a Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 5 Apr 2006 06:31:13 +0000 Subject: Bug 275637: Templatise 'voteremovedmail' email - Patch by Emmanuel Seyman r=LpSolit a=justdave --- Bugzilla/Bug.pm | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'Bugzilla/Bug.pm') diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 60779b29f..42bfe8664 100755 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -1048,23 +1048,26 @@ sub RemoveVotes { # Now lets send the e-mail to alert the user to the fact that their votes have # been reduced or removed. - my %substs; + my $vars = { - $substs{"to"} = $name . Param('emailsuffix'); - $substs{"bugid"} = $id; - $substs{"reason"} = $reason; + 'to' => $name . Param('emailsuffix'), + 'bugid' => $id, + 'reason' => $reason, - $substs{"votesremoved"} = $removedvotes; - $substs{"votesold"} = $oldvotes; - $substs{"votesnew"} = $newvotes; + 'votesremoved' => $removedvotes, + 'votesold' => $oldvotes, + 'votesnew' => $newvotes, - $substs{"votesremovedtext"} = $removedvotestext; - $substs{"votesoldtext"} = $oldvotestext; - $substs{"votesnewtext"} = $newvotestext; + 'votesremovedtext' => $removedvotestext, + 'votesoldtext' => $oldvotestext, + 'votesnewtext' => $newvotestext, - $substs{"count"} = $removedvotes . "\n " . $newvotestext; + 'count' => $removedvotes . "\n " . $newvotestext + }; - my $msg = perform_substs(Param("voteremovedmail"), \%substs); + my $msg; + my $template = Bugzilla->template; + $template->process("email/votes-removed.txt.tmpl", $vars, \$msg); push(@messages, $msg); } my $votes = $dbh->selectrow_array("SELECT SUM(vote_count) " . -- cgit v1.2.3-24-g4f1b