Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 30028

Inline CSS styles into pre-compiled Handlebars templates in Javascript

$
0
0

I'm using Handlebars to generate HTML for emails in a NodeJS environment. Since I'm generating emails, I'm inlining my styles.

My flow currently looks like this:

  1. Read Handlebars template file and compile into function
  2. Execute Handlebars function to get HTML
  3. Run CSS inliner over HTML
  4. Send email

I'd like to perform as much of this at build time. I know I can pre-compile my Handlebars templates to Javascript. Is there a way I can also do CSS inlining at build time?

Ideally my flow would be:

  1. Build time: Pre-compile Handlebars templates & inline CSS into JS
  2. Execute pre-compiled Handlebars function to get HTML
  3. Send email

Viewing all articles
Browse latest Browse all 30028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>