I created a custom theme that contains three templates html.tpl.php, page.tpl.php, and htmlmail--htmlmail.tpl.php. I have stripped out most everything, but a bunch of BRs and paragraphs are put into the message somehow. Here are my templates:
html.tpl.php:
<!DOCTYPE html>
<html lang="<?php print $language->language; ?>">
<head>
<meta charset="utf-8">
<?php print $head; ?>
<title><?php print $head_title; ?></title>
</head>
<body style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;background: #efebdf url(<?php print $theme_url ?>/R4MS_email_basefade_1px.jpg) repeat-y scroll left top;padding:0;margin:0;">
<?php print $page; ?>
</body>
</html>
page.tpl.php
<?php print render($page['content']); ?>
htmlmail--htmlmail.tpl.php
<div style="width:600px;height: 130px;padding:0;margin:0;">
<a href="http://readformyschool.co.uk"><img src="<?php print $theme_url ?>/R4MS_email_header.jpg" alt="R4MS logo"/></a>
</div>
<div style="padding:20px;width:600px;">
<?php echo $body; ?>
</div>
<div style="padding:0;margin:0;background:white;">
<div style="display:inline-block;margin:5px;"><span>©2013 Pearson Foundation | <a href="/legal">Legal</a> | <a href="/contact">Contact</a></span></div>
<div style="display:inline-block;margin:5px;"><a id="pearson-foundation-logo" href="http://pearsonfoundation.org" class="icon-inline"><img src="<?php print $theme_url ?>/lg-pf.png" alt="Pearson Foundation logo"/></a></div>
<div style="display:inline-block;margin:5px;"><a id="booktrust-logo" href="http://pearsonfoundation.org" class="icon-inline"><img src="<?php print $theme_url ?>/lg-bt.png" alt="Booktrust logo"/></a></div>
<div style="display:inline-block;margin:5px;"><a id="dept-ed-logo" href="http://pearsonfoundation.org" class="icon-inline"><img src="<?php print $theme_url ?>/lf-dfe.png" alt="Department of Education logo logo"/></a></div>
</div>
Comments
Comment #1
deggertsen commentedI had this same issue. The problem for me, and I bet it's the same for you, was that I had the filter "Convert line breaks into HTML (i.e.
<br>and<p>)" set. So because in the htmlmail.tpl.php I had some line breaks in the php code, the filter was converting them to<br>or<p>tags. So if you remove that filter from your mail filter it should fix the issue.Hopefully that fixes your problem. I'm going to close this as I don't think this is a problem with HTML Mail and this fix worked for me.