mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-31 10:26:23 +01:00
Remove html tags from email function (patched from 1.x)
Better score in tests
This commit is contained in:
@@ -823,11 +823,11 @@ function getWorldName($id)
|
|||||||
*
|
*
|
||||||
* @param string $to Recipient email address.
|
* @param string $to Recipient email address.
|
||||||
* @param string $subject Subject of the message.
|
* @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.
|
* @param string $altBody Alternative message body, plain text.
|
||||||
* @return bool PHPMailer status returned (success/failure).
|
* @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 */
|
/** @var PHPMailer $mailer */
|
||||||
global $mailer, $config;
|
global $mailer, $config;
|
||||||
@@ -841,15 +841,6 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
|||||||
$mailer->clearAllRecipients();
|
$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 = '<html><head></head><body>' . $body . '<br/><br/>' . $signature_html . '</body></html>';
|
|
||||||
else
|
|
||||||
$tmp_body = $body . '<br/><br/>' . $signature_html;
|
|
||||||
|
|
||||||
if($config['smtp_enabled'])
|
if($config['smtp_enabled'])
|
||||||
{
|
{
|
||||||
$mailer->isSMTP();
|
$mailer->isSMTP();
|
||||||
@@ -864,6 +855,12 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
|||||||
$mailer->isMail();
|
$mailer->isMail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($config['mail_signature']['html'])) {
|
||||||
|
$signature_html = $config['mail_signature']['html'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$tmp_body = $body . '<br/><br/>' . $signature_html;
|
||||||
|
|
||||||
$mailer->isHTML(isset($body[0]) > 0);
|
$mailer->isHTML(isset($body[0]) > 0);
|
||||||
$mailer->From = $config['mail_address'];
|
$mailer->From = $config['mail_address'];
|
||||||
$mailer->Sender = $config['mail_address'];
|
$mailer->Sender = $config['mail_address'];
|
||||||
|
|||||||
Reference in New Issue
Block a user