Body css in html email

Body css in html email

by Chardelle Busch -
Number of replies: 3
Picture of Core developers
Here's a question for the theme gurus.

When the forum posts are sent out in email using html format, the code uses the body style like this:

    $posthtml .= "\n<body id=\"email\">\n\n";

And, if you have a color or image for your body background in your stylesheet, it also shows up in the body of the email.  I'd rather have the body of the email not pick up that body background style (and just have white).

Any ideas?

Thanks
Average of ratings: -
In reply to Chardelle Busch

Re: Body css in html email

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Chardelle,
Try putting this in one of the CSS files of your theme.
#email { 
  background-color: #FFFFFF;
  background-image:none;
}
Joseph
In reply to Joseph Rézeau

Re: Body css in html email

by Chardelle Busch -
Picture of Core developers
Hi Joseph,

Thanks for the reply.  I tried this, along with several other configurations of it, body.#message, #email. body, etc, etc., but nothing so far has worked.  I'll let you know if I figure anything out.
In reply to Chardelle Busch

Re: Body css in html email

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Just a thought,
try
#email { 
  background-color: #FFFFFF!important;
  background-image:none!important;
}
Joseph