mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 16:24:43 +03:00
Do not die if "user_history" mail template cannot be loaded
This commit is contained in:
parent
6768fe96c2
commit
8a47afef58
@ -116,22 +116,25 @@ class MailController extends AbstractController
|
|||||||
|
|
||||||
// Load mail templates and substitute placeholders there.
|
// Load mail templates and substitute placeholders there.
|
||||||
$mail_template = MailTemplate::loadByName('user_history', get_current_locale());
|
$mail_template = MailTemplate::loadByName('user_history', get_current_locale());
|
||||||
if (!$mail_template) {
|
if ($mail_template) {
|
||||||
throw new \RuntimeException('Cannot load "user_history" mail template');
|
$this->sendMail(MailUtils::buildMessage(
|
||||||
|
$email,
|
||||||
|
MIBEW_MAILBOX,
|
||||||
|
$mail_template->buildSubject(),
|
||||||
|
$mail_template->buildBody(array(
|
||||||
|
$thread->userName,
|
||||||
|
$history,
|
||||||
|
Settings::get('title'),
|
||||||
|
Settings::get('hosturl'),
|
||||||
|
))
|
||||||
|
));
|
||||||
|
} else {
|
||||||
|
trigger_error(
|
||||||
|
'Cannot send e-mail because "user_history" mail template cannot be loaded.',
|
||||||
|
E_USER_WARNING
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sendMail(MailUtils::buildMessage(
|
|
||||||
$email,
|
|
||||||
MIBEW_MAILBOX,
|
|
||||||
$mail_template->buildSubject(),
|
|
||||||
$mail_template->buildBody(array(
|
|
||||||
$thread->userName,
|
|
||||||
$history,
|
|
||||||
Settings::get('title'),
|
|
||||||
Settings::get('hosturl'),
|
|
||||||
))
|
|
||||||
));
|
|
||||||
|
|
||||||
$page = setup_logo($group);
|
$page = setup_logo($group);
|
||||||
$page['email'] = $email;
|
$page['email'] = $email;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user