html - Actionmailer css adding to the whole app -


i'm trying style actionmailer mail view doing following:

i have email.css.scss file with:

@import "bootstrap-sprockets"; @import "bootstrap";  {     color: #23527c;     a:hover {         color: #1c70bb;     } } 

in assets.rb:

rails.application.config.assets.precompile += %w( email.css ) 

in send_email.html.erb:

<%= stylesheet_link_tag 'email' %> 

but when go app links a in color haven't imported email.css.scss in application.scss file.

how can put email.css.scss file read in specific email view?

also, rake assets:precompile if has it.

thanks!

edit:

i followed article on how send emails using rails , bootstrap:

http://stefan.haflidason.com/sending-emails-using-rails-and-bootstrap/

it uses 2 gems this:

gem 'nokogiri' gem 'premailer-rails' 

you can't. have style mailers inline (in actual mailer template), , once so, mailer styles won't have effect on rest of app. won't able use scss/sass there either.

the easiest way style mail templates use tag @ top of mailer template.

just because you've precompiled mailer assets along rest of app doesn't mean user's email program able load them. when comes email, inline/tables king. feels kind of 1995-ish, that's way is.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -