Inline css on dynamic content

i am guessing there is no way to do this unless the mail program does an inliner process near the end?

this is for things like merge codes (unsubscribe messages), how can you make the right styles get transferred into the section?

for example i can wrap my unsubscribe message in a <p style=“”></p>, but when there’s a link it will have to depend on a style section in the header.

Yeah, you’d probably need to generate the inline styles on to the elements you wanted targeted.

I quite frequently use Premailer, it allows you to write a stylesheet in an email and when run through the tool it will inline all the CSS.
It’s open source and written in Ruby if you fancy getting your hands dirty (or clean, depending on your opinion of Ruby ;))

Are you using a 3rd party mailing system? I know sometimes they do have alternative unsub tags that you might use, it depends on which one you’re using of course. Campaign Monitor for example have their <unsubscribe> tag which you can style as well.

thanks! yes i’m a big fan of premailer. i’m actually the one who suggested the tickbox for don’t remove <style> and <link> elements. they are needed for outlook 2007. I didn’t know it was open source?

I think campaign monitor and mailchimp both inline everything on the way out. I am using a system that isn’t as great as those, and i’m just trying to make this work. alas i think it’s all kind of pointless though.

I just noticed that Premailer has a beta API http://premailer.dialect.ca/api (I’m going to give that a whirl myself I think!)

The API looks like it might potentially solve your problem, of course running it locally will reduce the need to make a HTTP request to a remote server which could potentially take a while.

Source is available on GIThub https://github.com/alexdunae/premailer/