diff --git a/system/functions.php b/system/functions.php index acacd30e..0278882b 100644 --- a/system/functions.php +++ b/system/functions.php @@ -823,11 +823,11 @@ function getWorldName($id) * * @param string $to Recipient email address. * @param string $subject Subject of the message. - * @param string $body Message body in html format. + * @param string $body Message body in HTML format. * @param string $altBody Alternative message body, plain text. * @return bool PHPMailer status returned (success/failure). */ -function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) +function _mail(string $to, string $subject, string $body, string $altBody = ''): bool { /** @var PHPMailer $mailer */ global $mailer, $config; @@ -841,15 +841,6 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->clearAllRecipients(); } - $signature_html = ''; - if(isset($config['mail_signature']['html'])) - $signature_html = $config['mail_signature']['html']; - - if($add_html_tags && isset($body[0])) - $tmp_body = '' . $body . '

' . $signature_html . ''; - else - $tmp_body = $body . '

' . $signature_html; - if($config['smtp_enabled']) { $mailer->isSMTP(); @@ -864,6 +855,12 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->isMail(); } + if(isset($config['mail_signature']['html'])) { + $signature_html = $config['mail_signature']['html']; + } + + $tmp_body = $body . '

' . $signature_html; + $mailer->isHTML(isset($body[0]) > 0); $mailer->From = $config['mail_address']; $mailer->Sender = $config['mail_address'];