Closed (outdated)
Project:
HTML Mail
Version:
7.x-2.8
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Feb 2012 at 10:00 UTC
Updated:
29 Sep 2020 at 20:28 UTC
Jump to comment: Most recent
I created a subtheme for my mail theme. The generated HTML without any input filters active looks like this:
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta charset="utf-8" />
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
<title>corporate_dev has forwarded a page to you from clients | clients</title>
<style>@import url("http://clients.example.ch/modules/system/system.base.css?lzdmkd");
@import url("http://clients.example.ch/modules/system/system.messages.css?lzdmkd");
@import url("http://clients.example.ch/modules/system/system.theme.css?lzdmkd");</style>
<style>@import url("http://clients.example.ch/sites/all/modules/simplenews/simplenews.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/date/date_api/date.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/date/date_popup/themes/datepicker.1.7.css?lzdmkd");
@import url("http://clients.example.ch/modules/field/theme/field.css?lzdmkd");
@import url("http://clients.example.ch/modules/node/node.css?lzdmkd");
@import url("http://clients.example.ch/modules/user/user.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/views/css/views.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/extlink/extlink.css?lzdmkd");</style>
<style>@import url("http://clients.example.ch/sites/all/modules/ctools/css/ctools.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/ctools/css/modal.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/modal_forms/css/modal_forms_popup.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/panels/css/panels.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/modules/views_slideshow/views_slideshow.css?lzdmkd");</style>
<style>@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/fonts.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/html-reset.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/layout-fixed.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/page-backgrounds.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/tabs.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/pages.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/blocks.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/navigation.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/views-styles.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/panels-styles.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/nodes.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/comments.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/forms.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/fields.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/print.css?lzdmkd");
@import url("http://clients.example.ch/sites/all/themes/clients_mail/css/custom.css?lzdmkd");</style>
</head>
<body class="html not-front not-logged-in no-sidebars page-echo i18n-de section-echo" >
<div id="page-wrapper"><div id="page">
CONTENT
</div></div><!-- /#page, /#page-wrapper -->
</body>
</html>As soon as I activate one input filter it looks like this:
<div><div><div>
<div><div></div></div>
<div><div><div><div>
CONTENT
</div></div></div></div>
</div></div></div>
</html>What could be the problem?
Comments
Comment #1
pablov2 commentedLukas von Blarer are you using Emogrifier with HMTL Mail? I have the same issue.
Comment #2
luksakYes, I do. But it doesn't matter what filter I apply. All of them cause the same error. I switched to MIME Mail by now...
Comment #3
jmonma commentedThis seems like a potential duplicate of the issue posted for emogrifier, but if Lukas is right then HTML Mail is probably the right place for this issue: http://drupal.org/node/1336106
I am also experiencing a similar issue with the emogrifier post-filter enabled. When I debug, it seems like HTML Mail isn't properly passing the themed output to the filters.
Comment #4
pillarsdotnet commentedI believe that HTML Mail is discarding the HEAD portion of the document and only passing the BODY portion to filters.
Comment #5
j0rd commented@pillarsdotnet regarding #4.
I believe that HTML Mail is actually putting the entire htmlmail.tpl.php through the input filter and this causes many problems for me. I'm using the latest 6.x-2.64
I've created a new input filter and only added the "Turn new lines into <br />" filter. It seems that HTML Mail pushes the entire template through the filter, instead of just the $body, or other variables.
So a template like this
end up looking like this
Notice all the weird P and BR tags all over the place.
Also in the past I've seen problems with import filters and @import I believe. I can not recall where through. Also I would think perhaps the original problem of the poster might be related to filtering HTML (and not having the proper tags enabled). So the extra HTML is getting removed. Again though, if this only filtered over the body, then we wouldn't have a problem.
Comment #6
j0rd commentedSo, I've tracked down to where this is happening.
First lets start with these assumptions:
" filter to it.
Example htmlmail.tpl.php
Now in htmlmail/htmlmail.mail.inc `function format();` you have this line:
$body = theme('htmlmail', $message);which initialized body with the original body + htmlmail template.Then if we go down a little further, there's
This snippet runs the entire original body + htmlmail template through the input filter. This is the bug (or desired behavior?)
Either way, for me, this won't work. I simply need body run through the input filter. I could see how perhaps running other variables through the input filter may be important, but I believe the template itself should be left alone.
I'll submit a patch following this, which will simply input filter the $message['body'] variable, but since I'm not that familiar with the module, I'm not sure if that's the desired behavior.
Comment #7
neochief commentedHad the same issue as j0rd in #6. If you use any post filter in module options, all of your theming might suffer from it. I have no idea is it by design, but it looks like input formats are suppose to be run before theming happens, but not after.
I end-up with filtering body in my theme and disabling the postfilter option.
Comment #8
peterx commentedA quick question about filter sequence. Where is Emogrifier in the text format filter processing order? Does it work the same if Emogrifier is last in the list?
Comment #9
pillarsdotnet commentedYeah, Emogrifier should probably come last.
Comment #10
peterx commentedPathologic puts the following note on the text type config page. What happens when you use all the filter options recommended for HTML mail? They will all want to be last.
In most cases, Pathologic should be the last filter in the “Filter processing order” list.
Comment #11
pillarsdotnet commentedEmogrifier doesn't affect link hrefs, and pathologic doesn't affect style info, so their order relative to each other doesn't matter.
Comment #12
maico de jongWhile sending the 'request new password' mail through HTML Mail i also encounterd the same problem. Using HTML Mail + Emogrofier(Filter) + Convert to line breaks(filter).
After putting some html tags in the request new password message(admin/config/people/accounts) everything seems to work fine. So in my case the problem only exists when sending some plain text.
In that case: Maybe the problem comes from Drupal Core input format as explained in: http://drupal.org/node/1095838 ?
Comment #13
salvis