[TYPO3] direct_mail remove header css styles

Christopher Torgalson bedlamhotel at gmail.com
Fri Apr 11 22:25:17 CEST 2008


Hi,

On Fri, Apr 11, 2008 at 9:56 PM, Redvald Hjulstad <redvald at hjulstad.no> wrote:
> Hi,
>
>  I have set up mye template for direct_mail css by using only inline
>  css. But for styling the links I have added this to my ts setup:
>
>  page.headerData.10000 = HTML
>  page.headerData.10000.value(
>         <style type="text/css">
>  <!--
>  a {color: #DC1909}
>  -->
>         </style>
>
>  )
>
>  It is working on the website, but when the direct mail is created and
>  ends up in the email inbox that css code is removed from the css.
>
>  I have tried it on Apple Mail, Outlook, Gmail and Thunderbird. It is
>  the same on all apps. I think it is removed before it is sent, also
>  because there is some other code that a have not added:


<snip>


>  How can I keep my own css, and maybe (but this is not important) get
>  rid of the code that´s not mine?


Well, if you're targetting ANY webmail--you mentioned Gmail--you need
a different strategy altogether. Webmail clients do various weird,
aggravating things to email, but as you can probably imagine, they
*cannot* simply allow the <head> section of an HTML email to remain
'as is' (i.e. since they are HTML pages displaying your message which
is also an html document...)

Gmail, if I remember right strips the <head> section away entirely.
Yahoo mail used to do something like rename CSS selectors (or change
them to descendant selectors, I can't remember for sure...)

I really (really!) hate to recommend nonstandard coding, but for HTML
emails, one thing that works pretty widely is to put a CSS block (e.g.
a <style ... > element) somewhere inside the <body> of the email. Some
clients (e.g. Gmail) will ignore parts of it, but it generally works
well. Besides all of that, you'll find many cases where even today, it
sometimes works best with HTML emails to write the code like it's
1996...


-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list