Did you know you can inline CSS in Ruby on Rail’s mailers using the premailer-rails gem? You just need to drop it in & it’ll just work!
You can also use postcss-css-variables to calculate the value of CSS Variables, so they’ll fallback perfectly in older email clients such as Outlook.
- postcss-css-variables: https://github.com/MadLittleMods/postcss-css-variables
- premailer-rails: https://github.com/fphilipe/premailer-rails
- Source Code: https://github.com/MikeRogers0-YouTube/premailer-rails-demo