Closed shajunr88 closed 6 years ago
@shajunr88 you seem to be referencing 2.x version of this package. if you are, you'll need to see the docs here https://github.com/niftylettuce/email-templates/tree/2.x.
3.x was released https://github.com/niftylettuce/email-templates#v3-breaking-changes
can you confirm which version are you using?
Thanks for the response .It is working now with require('email-templates-v2')
@shajunr88 do not use that package -- it is not an officially supported one
instead you should do this:
npm uninstall email-templates-v2
npm install email-templates@2.x
I just installed the email templates and getting the same error doing this
const EmailTemplate = require('email-templates').EmailTemplate im following this example https://community.nodemailer.com/2-0-0-beta/templating/
I am using email-templates in express js for rendering emails.But when using this library, it shows TypeError: EmailTemplate is not a constructor
var EmailTemplate = require('email-templates').EmailTemplate; new EmailTemplate(templateDir);