Log and give the user an error message when the password recovery email template cannot be found/used. Fixes bug #12098.

This commit is contained in:
Colin Kuskie 2011-04-07 09:57:47 -07:00
parent f2f0338ab4
commit 5ca9da3784
2 changed files with 8 additions and 1 deletions

View file

@ -4,6 +4,7 @@
- fixed #12088: Organization left out of transaction
- fixed #12095: Shop admin screen has JS errors?
- fixed #12097: GroupManager pop-up not working
- fixed #12098: Missing template breaks WebGUI password recovery by email
7.10.13
- added #12079: Carousel Auto Play

View file

@ -1128,7 +1128,13 @@ sub emailRecoverPasswordFinish {
my $mail = WebGUI::Mail::Send->create($session, { to=>$email, subject=>$i18n->get('WebGUI password recovery')});
my $vars = { };
$vars->{recoverPasswordUrl} = $session->url->append($session->url->getSiteURL,'op=auth;method=emailResetPassword;token='.$recoveryGuid);
my $template = WebGUI::Asset->newByDynamicClass($session, $session->setting->get('webguiPasswordRecoveryEmailTemplate'));
my $templateId = $session->setting->get('webguiPasswordRecoveryEmailTemplate');
my $template = WebGUI::Asset->newByDynamicClass($session, $templateId);
if (!$template) {
$session->errorHandler->error("Can't instantiate template $templateId for template email recovery");
my $i18n = WebGUI::International->new($self->session, 'Asset');
return $i18n->get('Error: Cannot instantiate template').' '.$templateId;
}
my $emailText = $template->process($vars);
WebGUI::Macro::process($session, \$emailText);
$mail->addText($emailText);