Hacker News new | ask | show | jobs
by bpatrianakos 4949 days ago
I work with HTML emails all day long and it's awful. The short answer is this: remember, it's an email, not a full blown website. You should not have as much CSS as you're describing in your emails to begin with. The more CSS the more chances there are for it to break. Images and tables are the way to go and you'd be surprised at how creative you can get under those constraints and how beautiful the result can be.

Most web based email clients will rip out your <head> so link tags aren't a good idea. You'll need to inline 90%+ of your CSS. I usually create the table layout then add the inline style later. You can use the Mailchimp CSS inliner tool for quicker results.

I usually inline it all and leave some bits in a style tag. That's really the best you can do because of the crazy inconsistencies between email clients. Email clients render HTML and CSS like it's the 90's. Check out Campaign Monitor's blog. They have a big chart that shows you what HTML/CSS is compatible in each client. It's a life saver. I have it posted in my cube and I use it every day.

1 comments

So, as someone who works with HTML emails all day long, do you have an evaluation of the "responsive email templates" in the OP?

They seem to conflict with much of your advice to me. That's what I'm wondering about.

HTML emails in general are full of contradictions. I plan to use the templates myself and I'm really excited about them. To answer your question though, it's just important to realize that much of these techniques won't work in the majority of email clients. iOS and some Android built-in email clients are the ones that this will be great for. But at the same time you still have to inline the vast majority of your CSS to get a consistent result in webmail clients.

In the end you have to know your audience. At my job, we have a lot of corporate types who are checking their emails in Outlook and also webmail so the emails I create have only two style rules in the head of the document with the rest inlined. Email is just really fragile and I personally believe you have to resign yourself to the fact that your email will break for some of your readers. When I create a website I expect it to work beautifully for over 95% of people. With email, I expect it to work 3/4 of the time. Maybe more if I'm lucky. That of course depends on the complexity of the email's design of course.