Permalink
Browse files

Merge pull request #16 from vekexasia/patch-1

Fix the batch problem ( has no method slice )
  • Loading branch information...
2 parents 5b2847d + 520f897 commit 8936df737e5525bb80af911748f8e9a2bb6a7e3c @niftylettuce niftylettuce committed Nov 2, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/main.js
View
@@ -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) {

0 comments on commit 8936df7

Please sign in to comment.