The following commit breaks the order confirmations sent out by ubercart.
http://drupalcode.org/project/htmlmail.git/commitdiff/e80afff44d3809ab72...
Ubercart 7.x-3.0, HTML Mail 7.x-2.65, Mail System 7.x-2.34, Rules 7.x-2.1
When reverting this change the order confirmations looks normal again.
The broken order confirmations have *a lot* of < br / >:s after every row, creating a lot of whitespace that isn't supposed to be there.
It seems like every newline in the template are converted to a < br / >.
However, this only happens for the order confirmation sent out by rules. If I select to email a order confirmation in the Ubercart Store configuration it looks good.
I use the following patch to revert the change that breaks the template:
--- a/www/sites/all/modules/htmlmail/htmlmail.mail.inc
+++ b/www/sites/all/modules/htmlmail/htmlmail.mail.inc
@@ -46,7 +46,7 @@ class HTMLMailSystem implements MailSystemInterface {
}
else {
if (is_array($message['body'])) {
- $message['body'] = implode("<br />$eol<br />$eol", $message['body']);
+ $message['body'] = implode("$eol$eol", $message['body']);
}
$body = theme('htmlmail', $message);
if ($message['body'] && !$body) {
Comment | File | Size | Author |
---|---|---|---|
#2 | 2012-06-04_1333.png | 197.11 KB | generalredneck |
#2 | htmlmail-Remove_breaks-1534688-2.patch | 501 bytes | generalredneck |
Comments
Comment #0.0
johan.wilfer CreditAttribution: johan.wilfer commented-
Comment #0.1
johan.wilfer CreditAttribution: johan.wilfer commented-
Comment #1
pillarsdotnet CreditAttribution: pillarsdotnet commentedSo you want htmlmail to assume that if the message body is an array, the individual array elements are plaintext and not html.
Comment #2
generalredneckThis affects more than just Ubercart. I consider this a bug because we are using the "Unfiltered" Post-filtering and this code is adding breaks to our unfiltered html. We made the assumption that Unfiltered meant "Unfiltered Html" as well.
Unless I'm misunderstanding the usage of building templates for HTML mail, adding breaks on unfiltered mail seems wrong. See a screenshot of the results.
Also, I need to revert this line, but I need the patch in a file, so that's attached as well.
Comment #3
dieuwePatch works for me. Thanks :)
Comment #4
dieuweComment #5
generalredneckThanks, dieuwe. I always forget to put the dang status into needs review :P
Comment #6
pillarsdotnet CreditAttribution: pillarsdotnet commentedWorking on this...
Comment #7
pillarsdotnet CreditAttribution: pillarsdotnet commentedCommitted; will be included in next release.
Comment #8.0
(not verified) CreditAttribution: commented-