Skip to content

Commit b999690

Browse files
authored
When including a message in a template use the content of the body element if it is present instead of the complete message. (#938)
1 parent 5843469 commit b999690

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

public_html/lists/admin/sendemaillib.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ function sendEmail($messageid, $email, $hash, $htmlpref = 0, $rssitems = array()
309309

310310
if ($cached[$messageid]['template']) {
311311
// template used
312+
// use only the content of the body element if it is present
313+
if (preg_match('|<body.*?>(.+)</body>|is', $htmlcontent, $matches)) {
314+
$htmlcontent = $matches[1];
315+
}
312316
$htmlmessage = str_replace('[CONTENT]', $htmlcontent, $cached[$messageid]['template']);
313317
} else {
314318
// no template used

0 commit comments

Comments
 (0)