]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 100089: Templatise "passwordmail" email
authormozilla%colinogilvie.co.uk <>
Wed, 22 Feb 2006 06:36:03 +0000 (06:36 +0000)
committermozilla%colinogilvie.co.uk <>
Wed, 22 Feb 2006 06:36:03 +0000 (06:36 +0000)
Patch by Emmanuel Seyman <eseyman@linagora.com>; r=lpsolit; a=justdave

Bugzilla/BugMail.pm
Bugzilla/Config/MTA.pm
docs/xml/administration.xml
template/en/default/admin/params/mta.html.tmpl
template/en/default/email/password.txt.tmpl [new file with mode: 0644]

index f065cb5fc2ad7f11f07427caf4d6ca0d797f328f..da4005730245a6c095e9d66ae6288f1bbb0cb058 100644 (file)
@@ -32,6 +32,7 @@ use strict;
 
 package Bugzilla::BugMail;
 
+use Bugzilla::Error;
 use Bugzilla::User;
 use Bugzilla::Constants;
 use Bugzilla::Config qw(:DEFAULT $datadir);
@@ -793,11 +794,14 @@ sub encode_message_entity {
 # Send the login name and password of the newly created account to the user.
 sub MailPassword {
     my ($login, $password) = (@_);
-    my $template = Param("passwordmail");
-    my $msg = perform_substs($template,
-                            {"mailaddress" => $login . Param('emailsuffix'),
-                             "login" => $login,
-                             "password" => $password});
+    my $template = Bugzilla->template;
+    my $vars = {
+      mailaddress => $login . Param('emailsuffix'),
+      login => $login,
+      password => $password };
+    my $msg;
+    $template->process("email/password.txt.tmpl", $vars, \$msg)
+      || ThrowTemplateError($template->error());
     MessageToMTA($msg);
 }
 
index 4d2cd670395531bf6fd32fb28196e26b9b34b640..d331927db516af4d3deda05e6a4887272209d021 100644 (file)
@@ -62,23 +62,6 @@ sub get_param_list {
    default => 'localhost'
   },
 
-  {
-   name => 'passwordmail',
-   type => 'l',
-   default => 'From: bugzilla-daemon
-To: %mailaddress%
-Subject: Your Bugzilla password.
-
-To use the wonders of Bugzilla, you can use the following:
-
- E-mail address: %login%
-       Password: %password%
-
- To change your password, go to:
- %urlbase%userprefs.cgi
-'
-  },
-
   {
    name => 'newchangedmail',
    type => 'l',
index a32a61a59ec11763c011e3e2334bc813b6238f98..9357021295810b2405e5b35afc3e8171a99f17cd 100644 (file)
         </listitem>
       </varlistentry>
 
-      <varlistentry>
-        <term>
-          passwordmail
-        </term>
-        <listitem>
-          <para>
-            Every time a user creates an account, the text of this parameter
-            (with substitutions) is sent to the new user along with their
-            password message.
-          </para>
-
-          <para>
-            Add any text you wish to the "passwordmail" parameter box. For
-            instance, many people choose to use this box to give a quick 
-            training blurb about how to use Bugzilla at your site.
-          </para>
-        </listitem>
-      </varlistentry>
-
       <varlistentry>
         <term>
           movebugs
index 37d1d8e866d0686619700871fdeb16af1dbb8ea5..cb2454d62e997b4e29972a3599d069762c755b61 100644 (file)
 
   smtpserver => "The SMTP server address (if using SMTP for mail delivery).",
 
-  passwordmail => "The email that gets sent to people to tell them their password. " _
-                  "Within this text, %mailaddress% gets replaced by the person's " _
-                  "email address, %login% gets replaced by the person's login " _
-                  "(usually the same thing), and %password% gets replaced by their " _
-                  "password. %<i>anythingelse</i>% gets replaced by the " _
-                  "definition of that parameter (as defined on this page).",
-
   newchangedmail => "The email that gets sent to people when a $terms.bug changes. Within " _
                     "this text, %to% gets replaced with the e-mail address of the " _
                     "person receiving the mail. %bugid% gets replaced by the $terms.bug " _
diff --git a/template/en/default/email/password.txt.tmpl b/template/en/default/email/password.txt.tmpl
new file mode 100644 (file)
index 0000000..5993a90
--- /dev/null
@@ -0,0 +1,35 @@
+[%# 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: [% mailaddress %]
+Subject: Your [% terms.Bugzilla %] password.
+
+To use the wonders of [% terms.Bugzilla %], you can use the following:
+
+ E-mail address:  [% login %]
+       Password:  [% password %]
+
+ To change your password, go to:
+ [%+ Param("urlbase") %]userprefs.cgi
+