4
votes

I am sending emails using the mailgun library in Phoenix. Turns out that when i look at the email in my gmail account, it has been stripped off of all the css classes and the link to external css files.

Mailgun suggests using a css inline library http://blog.mailgun.com/transactional-html-email-templates/

Tried search a lot, but could not find a css inline library for Phoenix/Elixir like the premailer gem in Ruby. Does anyone know of a way to achieve this?

3

3 Answers

3
votes

I just released Smoothie, an Elixir library that does just this. We use this in our product at the startup I run, and decided to write our own library as we also couldn't find one in the elixir ecosystem yet. Check out the github page for installation instructions. Let me know if it works for you!

1
votes

There is also a library now called premailex which was released October 2017. It handles CSS inlining

0
votes

I have not been able to find anything myself but I believe you can find tools for that online and use them, it's not exactly the same but I guess it's better than to inline everything manually. For instance, you could use this one. I have not tested it though.

Also you can create a package yourself and share it with us :)