summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-06-08 05:47:19 +0200
committerlpsolit%gmail.com <>2006-06-08 05:47:19 +0200
commitc9c4a62258de4284df5a536b51f062b306a3c774 (patch)
treeb20ffc75cefb2f3daa3a39bb9c7db2720c8b2151
parentfb4c22207f27dc070149073cde8adb4ed8866250 (diff)
downloadbugzilla-c9c4a62258de4284df5a536b51f062b306a3c774.tar.gz
bugzilla-c9c4a62258de4284df5a536b51f062b306a3c774.tar.xz
Bug 275638: Templatise 'whinemail' email - Patch by Emmanuel Seyman <eseyman@linagora.com> r=LpSolit a=myk
-rw-r--r--Bugzilla/Config/MTA.pm44
-rw-r--r--template/en/default/admin/params/mta.html.tmpl13
-rw-r--r--template/en/default/email/whine.txt.tmpl65
-rwxr-xr-xwhineatnews.pl23
4 files changed, 79 insertions, 66 deletions
diff --git a/Bugzilla/Config/MTA.pm b/Bugzilla/Config/MTA.pm
index 7a6cc2ee0..474160a72 100644
--- a/Bugzilla/Config/MTA.pm
+++ b/Bugzilla/Config/MTA.pm
@@ -96,50 +96,6 @@ Configure bugmail: %urlbase%userprefs.cgi?tab=email
type => 't',
default => 7,
checker => \&check_numeric
- },
-
- {
- name => 'whinemail',
- type => 'l',
- default => 'From: %maintainer%
-To: %email%
-Subject: Your Bugzilla buglist needs attention.
-
-[This e-mail has been automatically generated.]
-
-You have one or more bugs assigned to you in the Bugzilla
-bugsystem (%urlbase%) that require
-attention.
-
-All of these bugs are in the NEW or REOPENED state, and have not
-been touched in %whinedays% days or more. You need to take a look
-at them, and decide on an initial action.
-
-Generally, this means one of three things:
-
-(1) You decide this bug is really quick to deal with (like, it\'s INVALID),
- and so you get rid of it immediately.
-(2) You decide the bug doesn\'t belong to you, and you reassign it to someone
- else. (Hint: if you don\'t know who to reassign it to, make sure that
- the Component field seems reasonable, and then use the "Reassign bug to
- default assignee of selected component" option.)
-(3) You decide the bug belongs to you, but you can\'t solve it this moment.
- Just use the "Accept bug" command.
-
-To get a list of all NEW/REOPENED bugs, you can use this URL (bookmark
-it if you like!):
-
- %urlbase%buglist.cgi?bug_status=NEW&bug_status=REOPENED&assigned_to=%userid%
-
-Or, you can use the general query page, at
-%urlbase%query.cgi
-
-Appended below are the individual URLs to get to all of your NEW bugs that
-haven\'t been touched for a week or more.
-
-You will get this message once a day until you\'ve dealt with these bugs!
-
-'
} );
return @param_list;
}
diff --git a/template/en/default/admin/params/mta.html.tmpl b/template/en/default/admin/params/mta.html.tmpl
index 3e5c8a9fa..4e9691701 100644
--- a/template/en/default/admin/params/mta.html.tmpl
+++ b/template/en/default/admin/params/mta.html.tmpl
@@ -75,17 +75,6 @@
whinedays => "The number of days that we'll let a $terms.bug sit untouched in a NEW " _
"state before our cronjob will whine at the owner.<br> " _
- "Set to 0 to disable whining.",
-
- whinemail => "The email that gets sent to anyone who has a NEW or REOPENED " _
- "$terms.bug that hasn't been touched for more than <b>whinedays</b>. " _
- "Within this text, %email% gets replaced by the offender's " _
- "email address. %userid% gets replaced by the offender's " _
- "$terms.Bugzilla login (which, in most installations, is the same as " _
- "the email address.) %<i>anythingelse</i>% gets replaced by the " _
- "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." }
+ "Set to 0 to disable whining." }
%]
diff --git a/template/en/default/email/whine.txt.tmpl b/template/en/default/email/whine.txt.tmpl
new file mode 100644
index 000000000..2e1061709
--- /dev/null
+++ b/template/en/default/email/whine.txt.tmpl
@@ -0,0 +1,65 @@
+[%# 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/field-descs.none.tmpl" %]
+From: [% Param("maintainer") %]
+To: [% email %][% Param("emailsuffix") %]
+Subject: Your [% terms.Bugzilla %] buglist needs attention.
+
+[This e-mail has been automatically generated.]
+
+You have one or more [% terms.bugs %] assigned to you in the [% terms.Bugzilla %]
+[% terms.bug %] tracking system ([% Param("urlbase") %]) that require
+attention.
+
+All of these [% terms.bugs %] are in the [% status_descs.NEW %] or
+[% status_descs.REOPENED %] state, and have not been
+touched in [% Param("whinedays") %] days or more.
+You need to take a look at them, and decide on an initial action.
+
+Generally, this means one of three things:
+
+(1) You decide this [% terms.bug %] is really quick to deal with (like, it's [% resolution_descs.INVALID %]),
+ and so you get rid of it immediately.
+(2) You decide the [% terms.bug %] doesn't belong to you, and you reassign it to
+ someone else. (Hint: if you don't know who to reassign it to, make
+ sure that the Component field seems reasonable, and then use the
+ "Reassign [% terms.bug %] to default assignee of selected component" option.)
+(3) You decide the [% terms.bug %] belongs to you, but you can't solve it this moment.
+ Just use the "Accept [% terms.bug %]" command.
+
+To get a list of all [% status_descs.NEW %]/[% status_descs.REOPENED %] [%+ terms.bugs %], you can use this URL (bookmark
+it if you like!):
+
+ [% Param("urlbase") %]buglist.cgi?bug_status=NEW&bug_status=REOPENED&assigned_to=[% email %]
+
+Or, you can use the general query page, at
+[%+ Param("urlbase") %]query.cgi
+
+Appended below are the individual URLs to get to all of your [% status_descs.NEW %] [%+ terms.bugs %]
+that haven't been touched for a week or more.
+
+You will get this message once a day until you've dealt with these [% terms.bugs %]!
+
+[% FOREACH bug = bugs %]
+ [%+ bug.summary %]
+ -> [% Param("urlbase") %]show_bug.cgi?id=[% bug.id %]
+[% END %]
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);