News for hackers. Stuff that matters.
Re:Transactional HTML Email Templates by sundance0 on Wednesday August 13, 2014 @01:02PM (#8173891)
These are great, and really simple to use. Already adapted for my latest project!

Also, if you didn't catch it in there: the [premailer][1] library is awesome, and helps make email templates more manageable (use CSS/LESS/SCSS styles like normal, then run your HTML email through premailer before shipping and it'll inline everything for you). I use the Python library with Django to preflight emails before sending. Works like a charm!

[1]: https://github.com/peterbe/premailer/tree/master

Also available in Ruby, Node, and PHP flavors

Re:Transactional HTML Email Templates by dirtae on Wednesday August 13, 2014 @07:58PM (#8175532)
The original post and your comment both make it sounds like the various premailer libraries all share a common core, but I don't think that is true. Does the python premailer have anything to do with premailer.dialect.ca? I don't think it does.

Several months ago, when I was using Zurb Ink to design some emails, the python premailer would choke on some of the responsive CSS. I had to switch to the ruby premailer gem to get things to work. It looks like the python premailer has since been updated, so perhaps it works now.

Re:Transactional HTML Email Templates by e0 on Wednesday August 13, 2014 @01:56PM (#8174142)
Why is it better to use inline CSS here? Isn't inline CSS usually frowned-upon?
Re:Transactional HTML Email Templates by ceejayoz on Wednesday August 13, 2014 @02:41PM (#8174378)
> Isn't inline CSS usually frowned-upon?

Yes, but not in the 1990s, which is the era HTML email finds itself stuck in.

Re:Transactional HTML Email Templates by 23andwalnut on Wednesday August 13, 2014 @02:05PM (#8174194)
Email clients strip external css and often the style tag. Therefore you have to use inline css to style html emails.
Re:Transactional HTML Email Templates by sundance0 on Wednesday August 13, 2014 @02:06PM (#8174200)
Most browser-based email clients (Gmail, Yahoo, etc.) strip out the head and body tags from HTML emails. You never really know what's going to be removed, so the safest thing is to inline all of your styles.
Re:Transactional HTML Email Templates by mtdewcmu on Thursday August 14, 2014 @06:10AM (#8176762)
Yes. But generally when things are frowned-upon, it's because they have something going for them. (If everyone agrees that something is dumb, there's no point in belaboring it.) Inlining is the simplest and most fool-proof way to apply CSS, which helps explain why it works in email where all else fails.
Re:Transactional HTML Email Templates by pdenya on Wednesday August 13, 2014 @01:10PM (#8173927)
Premailer is amazing. Saves me a huge amount of trouble regularly. For one thing you can just remove the external stylesheet reference to see how it degrades instead of s/style=/ignorestyle=/g or similar.
Re:Transactional HTML Email Templates by mrmch on Wednesday August 13, 2014 @02:31PM (#8174326)
One of the core features of Sendwithus that we DON'T talk about is the fact that we inline css for you at send time.

Such a pain to build out a inlining and testing workflow for content that should be in some kind of cms.