mailgen icon indicating copy to clipboard operation
mailgen copied to clipboard

Option to minify html template code.

Open iplanwebsites opened this issue 3 years ago • 1 comments

Whitespace accounts to 50% of the file-size of generated emails. This can quickly add up in queueing systems that notifies thousands of users. To save CPU cycles, it'd be best to minimize the templates on init, instead of running the minifier on the output, or at render time.

Ideally just after loading it via this.cachedTheme = fs.readFileSync(themePath, 'utf8');.

iplanwebsites avatar Mar 25 '22 19:03 iplanwebsites

Hi @iplanwebsites, Thanks so much for creating this issue and bringing this to my attention!

Would you like to submit a PR with this performance improvement? It would be welcome.

eladnava avatar Mar 25 '22 22:03 eladnava