fphilipe / premailer-rails

CSS styled emails without the hassle.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inline style tags show up as content in text email

armchairdj opened this issue · comments

I'm trying to put an actual <style> tag into my email to force crappy modern versions of Outlook to do the right thing. This is resulting in the CSS code inside the style tag showing up in my text emails as content:

screen shot 2018-12-13 at 8 45 18 am

I've tried this both with and without wrapping the style tag in a conditional comment:

<body>

<!--[if mso]>
<style type="text/css">
body, table, td, h1, h2, h3, h4, h5, h6, p, li, span, b, i, strong, em, a {
  font-family: Helvetica, Arial, sans-serif !important;
}
</style>
<![endif]-->

and

<body>

<style type="text/css">
body, table, td, h1, h2, h3, h4, h5, h6, p, li, span, b, i, strong, em, a {
  font-family: Helvetica, Arial, sans-serif !important;
}
</style>

Is there some trick I'm missing to ignore style tags in the text email generation? It seems like that should be the default - a style tag is never going to contain user-oriented content, just code.

Any advice would be appreciated. Thanks!

I don't know. Maybe just disable text generation. Hope that helps.