Email CSS not applied in production. Premailer-rails with TailwindCSS on Heroku

682 Views Asked by At

Background

Tailwind is set-up using the cssbundling-rails gem which bundles all CSS into a single file: app/assets/builds/application.tailwind.css.

In dev env, emails are correctly rendered as premailer-rails turns the (tailwind) CSS classes into inline styles. I use mailcatcher to preview emails. This works because of the reference to the stylesheet in layouts/mailer.html.erb:

<%= stylesheet_link_tag "application" %>

Problem

In production env (heroku), emails are not rendered with CSS. The CSS classess have been removed without being replaced by inline-styles.

Any ideas?

Many thanks in advance.

0

There are 0 best solutions below