diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 059f421c4..9a348a308 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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 diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index 114cd2587..4def4a10d 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -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);