sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
300 stars 65 forks source link

Inline styling not being applied in heroku #26

Closed ggraca closed 6 years ago

ggraca commented 6 years ago

I have some emails made with mjml that worked well in the dev setup but when we deployed to heroku they lost some of the styles.

Narrowing it down, I noticed that only the ones declared under <mj-style inline="inline"> were missing. All of the mjml got translated along with its default styles (for columns and tables for example)

This, for example, would change the element color in dev but not in heroku:

<mj-style inline="inline">
  .bblue { color: blue }
</mj-style>

Gemfile.lock -> mjml-rails (2.4.3) package.json -> "dependencies" {"mjml": "^3.0.0"}

Is there any known reason for this to fail?

sighmon commented 6 years ago

@ggraca Could you confirm the versions of MJML installed on your dev machine and heroku?

Locally: $ MJML --version

Heroku: $ heroku run shell heroku$ cd node_modules heroku$ mjml-cli --version

ggraca commented 6 years ago

@sighmon both 3.3.5

sighmon commented 6 years ago

@ggraca It shouldn't matter, but does it help if you add the trailing semi-colon? I haven't come across anything like this sorry.

<mj-style inline="inline">
  .bblue { color: blue; }
</mj-style>
ggraca commented 6 years ago

@sighmon i don't think it matters. I tested with some different snippets and before that we were working with our whole css but, when pushing to heroku, none of the styles showed either way.

<%= Rails.application.assets_manifest.find_sources('application.css').first.to_s.html_safe.force_encoding(Encoding::UTF_8) %>

We ended up upgrading to the latest version and it seems to work fine :muscle:. Thanks anyway. Should I close this?

sighmon commented 6 years ago

@ggraca Glad the latest version worked. Hopefully it was an underlying bug in MJML and won't show up again. Yeah, close this one.