]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 275637: Templatise 'voteremovedmail' email - Patch by Emmanuel Seyman <eseyman...
authorlpsolit%gmail.com <>
Wed, 5 Apr 2006 06:31:13 +0000 (06:31 +0000)
committerlpsolit%gmail.com <>
Wed, 5 Apr 2006 06:31:13 +0000 (06:31 +0000)
Bugzilla/Bug.pm
Bugzilla/Config/MTA.pm
template/en/default/admin/params/mta.html.tmpl
template/en/default/email/votes-removed.txt.tmpl [new file with mode: 0644]

index 60779b29fca31f76d6491fc85acb6652d29e10bd..42bfe8664c87c504a1c3e3e0cee5d36ca3ccda5f 100755 (executable)
@@ -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) " .
index 47370d34e4e41c5eef5502ac27ffa5a054e7e417..7a6cc2ee00ca1d14d9062b8fc851e3918bf8f69f 100644 (file)
@@ -139,25 +139,6 @@ haven\'t been touched for a week or more.
 
 You will get this message once a day until you\'ve dealt with these bugs!
 
-'
-  },
-
-  {
-   name => 'voteremovedmail',
-   type => 'l',
-   default => 'From: bugzilla-daemon
-To: %to%
-Subject: [Bug %bugid%] Some or all of your votes have been removed.
-
-Some or all of your votes have been removed from bug %bugid%.
-
-%votesoldtext%
-
-%votesnewtext%
-
-Reason: %reason%
-
-%urlbase%show_bug.cgi?id=%bugid%
 '
   } );
   return @param_list;
index cb2454d62e997b4e29972a3599d069762c755b61..3e5c8a9fa271ee33cd310e49f8765ef161b72549 100644 (file)
                "definition of that parameter (as defined on this page).<p> " _
                "It is a good idea to make sure this message has a valid From: " _
                "address, so that if the mail bounces, a real person can know " _
-               "that there are $terms.bugs assigned to an invalid address.",
+               "that there are $terms.bugs assigned to an invalid address." }
 
-  voteremovedmail => "This is a mail message to send to anyone who gets a vote removed " _
-                     "from $terms.abug for any reason. %to% gets replaced by the person who " _
-                     "used to be voting for this ${terms.bug}. %bugid% gets replaced by the " _
-                     "$terms.bug number. %reason% gets replaced by a short reason describing " _
-                     "why the vote(s) were removed. %votesremoved%, %votesold% and " _
-                     "%votesnew% is the number of votes removed, before and after " _
-                     "respectively. %votesremovedtext%, %votesoldtext% and " _
-                     "%votesnewtext% are these as sentences, e.g. 'You had 2 votes on " _
-                     "this ${terms.bug}.' %count% is also supported for backwards " _
-                     "compatibility. %<i>anythingelse</i>% gets replaced by the " _
-                     "definition of that parameter (as defined on this page)." }
 %]
diff --git a/template/en/default/email/votes-removed.txt.tmpl b/template/en/default/email/votes-removed.txt.tmpl
new file mode 100644 (file)
index 0000000..e9f1db3
--- /dev/null
@@ -0,0 +1,38 @@
+[%# 1.0@bugzilla.org %]
+[%# The contents of this file are subject to the Mozilla Public
+  # License Version 1.1 (the "License"); you may not use this file
+  # except in compliance with the License. You may obtain a copy of
+  # the License at http://www.mozilla.org/MPL/
+  #
+  # Software distributed under the License is distributed on an "AS
+  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+  # implied. See the License for the specific language governing
+  # rights and limitations under the License.
+  #
+  # The Original Code is the Bugzilla Bug Tracking System.
+  #
+  # The Initial Developer of the Original Code is Netscape Communications
+  # Corporation. Portions created by Netscape are
+  # Copyright (C) 1998 Netscape Communications Corporation. All
+  # Rights Reserved.
+  #
+  # Contributor(s): Emmanuel Seyman <eseyman@linagora.com>
+  #%]
+
+[% PROCESS global/variables.none.tmpl %]
+
+From: bugzilla-daemon
+To: [% to %]
+Subject: [% terms.Bug %] [%+ bugid %] Some or all of your votes have been removed.
+
+Some or all of your votes have been removed from [% terms.bug %] [%+ bugid %].
+
+[% votesoldtext %]
+
+[% votesnewtext %]
+
+Reason: [% reason %]
+
+
+[% Param("urlbase") %]show_bug.cgi?id=[% bugid %]
+