1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 17:50:12 +02:00

Fix for poorly formatted text emails derived from html tables.

This commit is contained in:
Cameron
2021-10-25 09:34:13 -07:00
parent 4d88e6575e
commit 723974a0ba
2 changed files with 27 additions and 3 deletions

View File

@@ -1333,6 +1333,8 @@ class e107Email extends PHPMailer
$this->Body = $message;
//print_a($message);
$textMsg = str_replace("\n", "", $message);
$textMsg = str_replace('</td>', "\t", $textMsg);
$textMsg = str_replace("</tr>", "\n", $textMsg);
$textMsg = str_replace(array('<br />', '<br>'), "\n", $textMsg); // Modified to make sure newlines carried through
$textMsg = preg_replace('#^.*?<body.*?>#', '', $textMsg); // Knock off everything up to and including the body statement (if present)
$textMsg = preg_replace('#</body.*?>.*$#', '', $textMsg); // Knock off everything after and including the </body> (if present)
@@ -1355,7 +1357,7 @@ class e107Email extends PHPMailer
$this->AltBody = 'To view this email message, enable HTML!' . "\n\n";
}
return $this->Body;
return $this->Body;
}