Transactional Email & Templated Email for NodeJS done right
Clear Separation of Concerns
Supports any Template Engine (e.g. Underscore Templates)
Mailing.compile(mailDir, {templateEngine: engine});Supports any Mail Provider (e.g Mandrill)
Mailing.compile(mailDir, {mailProvider: require('transacemail-mandrill')('apikey')});Supports any number of CSS files for each email. CSS is automatically inlined for free thanks to Juice
Supports any file extension
Mailing.Mail.DEFAULT_HTML_EXT = ".html";Mailing.Mail.DEFAULT_TEXT_EXT = ".text";Mailing.Mail.DEFAULT_META_EXT = ".meta.js";See the working example code . We accept pull-requests!
My name is Francois-Guillaume Ribreau, I discover, share (twitter), learn (blog), code (github), do.
Meta file extension
Mail.DEFAULT_META_EXT = '.meta.js';
HTML mail format extension
Mail.DEFAULT_HTML_EXT = '.html';
TEXT mail format extension
Mail.DEFAULT_TEXT_EXT = '.txt';
| Option name | Type | Description |
|---|---|---|
| templateEngine | Object | Template Engine that will be used to render the mail |
| metaPath | String | Path to the mail meta file |
Mail Factory
Mail.Factory = function(templateEngine, metaPath){
return new Mail(templateEngine, metaPath)
._readMeta()
._readHTML()
._mergeCss()
._readText();
};