Closed (fixed)
Project:
Simplenews
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2006 at 11:16 UTC
Updated:
20 Nov 2010 at 22:10 UTC
Hello,
I am creating a template for a newsletter. What is the best way to design it?
Is it possible to create a standard complient (xhtml-strict) design linked to a css style sheet?
If so, how and where is the link to the stylesheet inserted?
Or, if it's better to send the style sheet with the mail, how can it be inserted so that it's valid both for the email sent, and what's viewed on the site?
I'm very confused here by such issues.
Any pointer?
thank you.
Comments
Comment #1
beginner commentedThe following is helpful:
http://css-discuss.incutio.com/?page=StyleInEmail ,
http://www.reachcustomersonline.com/content/2004/11/11/09.27.00/index.php ,
http://www.sitepoint.com/article/code-html-email-newsletters ,
So, it seems that it's impossible to have, on one side, an html email that displays properly (almost) everywhere, AND the copy of the newsletter kept online, as part of the site, which is standard complient...
Any suggestion on how to improve the code so that the version sent and the one archived are optimized for their respective uses?
Comment #2
fredhead commentedAs the guy who (happily, luckily) published the 2nd and 3rd links offered by beginner, I would add that when you send an email you have two choices:
1. Embed the stylesheet information in your email before the close of the head tag.
2. Divide up the styles and attach them to table TD cells as well as the H1, H2, H3, P, IMG, and A tags within your email, with no embedded stylesheet.
The former approach will result in your stylesheet being ripped out by Google Mail (GMail) and similar services. Don't ask me why. The second approach results in a lot of repetitive code but works in GMail and most of the older email software.
As for using the same stylesheet in your email as in your archived email newsletters on your website, if I understood the question, in scenario 1 above, you can maintain one stylesheet for both the email and the archived version/page. In the second scenario above, you have to maintain two stylesheets, one for the archived version/page and a second collection of styles that have been cut and pasted from that master stylesheet.
Finally, I'd note that the SitePoint link goes to a version of an article they were good enough to publish in November 2004. The ReachCustomersOnline.com link goes to the same article but that article has been updated several times, most recently to document how to code for Google Mail. The SitePoint link is useful, however, for its link to a forum about the article; there you'll find several good alternate approaches to coding email newsletters.
Hope that helps.
Tim
Comment #3
FreeFox commentedI spent a few hours on how to style the outgoing newsletters and found out that when you use mimemail then the last block of the mimemail.module checks if the file "mail.css" exists in your theme folder. If so it will use it.
I needed to set the background-color for the newsletter (because standard it takes the site background-color) and I wanted to hide the title on top of the newsletter (when sent). This is the content of my mail.css and now it looks like I want:
Hope this helps someone.
Success
Jan
Comment #4
sutharsan commentedComment #5
mattwmc commentedYes! That was it! Thanks!