Mange / roadie-rails

Making HTML emails comfortable for the Rails rockstars
MIT License
363 stars 65 forks source link

ActionMailer::Preview CSS not being inlined #12

Closed jaymiejones86 closed 10 years ago

jaymiejones86 commented 10 years ago

When using the new ActionMailer::Preview functionality in Rails 4.1, if I create a new layout file for my HTML emails, and use a stylesheet link tag to my email.css.scss file, the preview works as expected, but this causes issues in production where it cannot find the email.css file (it has been added to the precompilation list).

Using the mail to: user.email, subject: "Welcome", css: 'email' method does not inline the required css file. This appears to work correctly when using the mail_view gem.

This issue very well could be to do with Rails itself, but thought there may be something in roadie-rails that is not hooking in correctly to the new previewer.

Mange commented 10 years ago

The :css option was for old Roadie. roadie-rails is only for the new Roadie and should work with Rails 4.

Are you sure that you are running Roadie 3? If so, are you sure the stylesheets were inlined and not just applied by your browser like usual? If you are using Roadie 3 with roadie-rails, which nailer module are you including? Automatic only inlines styles on delivery, Mailer inlines when it is generated.

I hope that helps. Den 21 jul 2014 02:40 skrev "Jaymie Jones" notifications@github.com:

When using the new ActionMailer::Preview functionality in Rails 4.1, if I create a new layout file for my HTML emails, and use a stylesheet link tag to my email.css.scss file, the preview works as expected, but this causes issues in production where it cannot find the email.css file (it has been added to the precompilation list).

Using the mail to: user.email, subject: "Welcome", css: 'email' method does not inline the required css file. This appears to work correctly when using the mail_view gem.

This issue very well could be to do with Rails itself, but thought there may be something in roadie-rails that is not hooking in correctly to the new previewer.

— Reply to this email directly or view it on GitHub https://github.com/Mange/roadie-rails/issues/12.

jaymiejones86 commented 10 years ago

That helps perfectly. It was my mistake, misread the docs regarding Automatic and Mailer. Everything is working great in dev and production now.

Thanks for your help and great job on Roadie and Roadie Rails, love it!

Mange commented 10 years ago

Thanks a lot. I'm glad it worked out for you! :-) Den 28 jul 2014 06:57 skrev "Jaymie Jones" notifications@github.com:

That helps perfectly. It was my mistake, misread the docs regarding Automatic and Mailer. Everything is working great in dev and production now.

Thanks for your help and great job on Roadie and Roadie Rails, love it!

— Reply to this email directly or view it on GitHub https://github.com/Mange/roadie-rails/issues/12#issuecomment-50300321.