From 3e11f000416834e4dd994012d8852e8e55251d1f Mon Sep 17 00:00:00 2001 From: "mozilla%colinogilvie.co.uk" <> Date: Wed, 22 Feb 2006 06:36:03 +0000 Subject: Bug 100089: Templatise "passwordmail" email Patch by Emmanuel Seyman ; r=lpsolit; a=justdave --- Bugzilla/BugMail.pm | 14 +++++++++----- Bugzilla/Config/MTA.pm | 17 ----------------- 2 files changed, 9 insertions(+), 22 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index f065cb5fc..da4005730 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -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); } diff --git a/Bugzilla/Config/MTA.pm b/Bugzilla/Config/MTA.pm index 4d2cd6703..d331927db 100644 --- a/Bugzilla/Config/MTA.pm +++ b/Bugzilla/Config/MTA.pm @@ -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', -- cgit v1.2.3-24-g4f1b