Cannot set property 'useTemplate' of undefined
Closed this issue · 2 comments
prasad47 commented
hi,
Code :-
var path = require('path'),
emailTemplates = require('swig-email-templates'),
_ = require('lodash');
var options = {
root: path.join(__dirname, '../templates')
// any other swig options allowed here
};
console.log('-------------------------------------------options'+JSON.stringify(options));
exports.orderConfirm=function(order,callback){
emailTemplates(options, function(err, render) { Line 42
render('email/order-confirm.html', order, function(err, html) {
callback(html);
});
});
};
Following Error Happening : -
------------------------------------------options{"root":"/app/templates"} precise as per the Folder structure ..
TypeError: Cannot set property 'useTemplate' of undefined
at EmailTemplates (/app/node_modules/swig-email-templates/index.js:32:20)
at Object.exports.orderConfirm(/app/app/controllers/emailTemplates.server.controller.js:42:5)
Could You Guys Suggest i am stuck with out clue :-(
Thanks,
Prasad
prasad47 commented
any one have seen it guys ... ????
takkaria commented
It looks like you are not using the most up to date version of the library. Please try upgrading, and see the README about the right way to use it now.