Our htmlmail.tpl.php template starts like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php print $subject; ?></title>
</head>
<body>

And ends like this:

</body>
</html>

HOWEVER, we don't get any of those 7 lines of code and the end is just </html> no closing body tag. We made our own EMAIL input format with only these filters enabled:

Transliteration
Emogrifier
Correct URLs with Pathologic

Comments

drubage’s picture

Issue summary: View changes

updated to use code tags

pillarsdotnet’s picture

Emogrifier shouldn't be used on input; only on output.

drubage’s picture

Word up, thank you!

drubage’s picture

Status: Active » Closed (works as designed)
jwilson3’s picture

Status: Closed (works as designed) » Active

I dont understand how this works as designed.

The HTML Mail *tells* us specifically to use an input format to filter emails *after* theming, and specifically suggests using Emogrifier. When enabled, emogrifier strips doctype, html, head, body tags, as well as any tags inside the head section (eg styles, meta). When disabled, it works as it should, however, you completely lose the emogrification, and thus lose cross-client visual consistency.

This is still a valid bug, unless someone can explain where to add emogrifier into the mix.

pillarsdotnet’s picture

Try reading the documentation?

jwilson3’s picture

I have read the documentation, quoting it here:

    [...]
    any combination of over 200 filter modules may be used to create an 
    email-specific text format for post-template filtering.
          + [21]Line break converter
          + [22]URL Filter
          + [23]Relative Path to Absolute URLs
          + [24]Emogrifier
          + [25]Token support
    [...]
    3. Post-filtering
       You may choose a text format to be used for filtering email
       messages after theming. This allows you to use any combination of
       over 200 filter modules to make final changes to your message
       before sending.
       Here is a recommended configuration:
          + Emogrifier Converts stylesheets to inline style rules for
            consistent display on mobile devices and webmail.
          + Transliteration Converts non-ASCII text to US-ASCII
            equivalents. This helps prevent Microsoft "smart-quotes" from
            appearing as question-marks in Mozilla Thunderbird.
          + Pathologic Converts relative URLS to absolute URLS so that
            clickable links in your message will work as intended.
    [...]
    * If you use a post-filter, make sure your filter settings page looks
       like [44]this.
    [...]

We do not want to use the Echo module, which would require building an entire theme to wrap the email in a simple email template file. Thus, we've placed all the html from <doctype> to </html> into the htmlmail.tpl.php file, and built a custom text format for post template filtering, and have added the emogrifier filter, the line-break filter, and the Correct URLs with Pathologic filter. In a configuration very similar to what is recommended in the screenshot linked from documentation ([44] above). We set this filter in *part 3* on the HTML Mail configuration screen (Post-filtering). When the emails are sent, the elements in the OP get stripped.

I dont know what I'm doing wrong here. Any help or suggestions beyond just RTFM would be very welcome. Thanks! :)

jwilson3’s picture

To shorten things down, you say "dont use emogrifier on input only output". We'll my response is, we are not using emogrifier on input, we have it properly configured to run *after* theming, as HTML Mail requires, and it *still* strips the code above.

Its possible I'm getting lost in translation of what you mean by input versus output, but i could find no other place to specify what format to use than the Post-filtering format on the HTML Mail config screen.

I stand by my statement that this still seems like a bug. Is anything else relevant to help trouble shoot this issue?

pillarsdotnet’s picture

Will look into when I get a chance.

tchopshop’s picture

Title: HTMLMail + Emogrifier strips HTML, HEAD, & BODY tags » HTML. head, body tags stripped?

having the same trouble... even without emogrifier enabled as a post filter, the html and body tags are being stripped and replaced by <p> tags.

jwilson3’s picture

@tchopshop, your post got munged; try wrapping code samples in <code> </code>

jwilson3’s picture

Title: HTML. head, body tags stripped? » HTMLMail + Emogrifier strips HTML, HEAD, & BODY tags

Also, this issue is specific to the Emogrifier integration. If you're having issues with other configuration that is not related to the presence of the Emogrifier, please file a separate issue.

tchopshop’s picture

Title: HTML. head, body tags stripped? » HTMLMail + Emogrifier strips HTML, HEAD, & BODY tags

Sorry, I am having a lot of trouble with emogrifier-- I've tried everything, nothing has worked. But I think the p tag issue is related to the wysiwyg filter that I must use also.

I wrote up my woes here (on the Emogrifier issue queue):
http://drupal.org/node/1336106

John Franklin’s picture

This can be closed as a duplicate of #1842946: Modify HTML code only by the Emogrifier library.

John Franklin’s picture

Issue summary: View changes

code updates

jacob.embree’s picture

Version: 7.x-2.65 » 7.x-2.x-dev
Issue summary: View changes
Status: Active » Closed (duplicate)
Related issues: +#1842946: Modify HTML code only by the Emogrifier library

As suggested in #13, closed as a duplicate.