Skip to content

Commit

Permalink
Merge pull request #16 from vekexasia/patch-1
Browse files Browse the repository at this point in the history
Fix the batch problem ( has no method slice )
  • Loading branch information
niftylettuce committed Nov 2, 2012
2 parents 5b2847d + 520f897 commit 8936df7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/main.js
Expand Up @@ -51,14 +51,18 @@ var EmailTemplate = function(templateDirectory, defaults, done) {
bufferType = that.bufferType
}

if (typeof html === 'function') {
callback = html;
html = that.html;
}
if (!html) html = that.html
if (!text) text = that.text
if (!stylesheet) stylesheet = that.stylesheet
locals = _.defaults(locals, (typeof defaults === 'object') ? defaults : {});
html = ejs.render(html, locals);
text = (text) ? ejs.render(text, locals) : '';
if (stylesheet) html = juice(html, stylesheet);
if (typeof html === 'function') callback = html;


// return a compressed buffer
if (isBuffer) {
Expand Down

0 comments on commit 8936df7

Please sign in to comment.