First-class e-mail support


#1

This is the ratchet, probably totally brittle way I find my app’s css to later be inlined in my e-mail html:

// server/sendEmailExample.js

var fs = Npm.require('fs');
...
var cssName = _.find(Object.keys(WebAppInternals.staticFiles), function (fileName) { return /.css$/.test(fileName) });
var cssPath = WebAppInternals.staticFiles[cssName].absolutePath;
var css = fs.readFileSync(cssPath);
...
var html = SSR.render(...);
var htmlWithInlineCss = juice(html, {extraCss: css});

Has anyone come across a better way to access the app’s css?


#2

This is actually the most amazing thing I’ve ever seen.


#3

Whoa! Dude! Seriously! This is amazing!


#4

Yep. That’s up at the top of the list of “Cool things I’ve seen today”.


#5

Very elegant! :smile: