forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.67k stars 337 forks source link

EmailTemplate is not a constructor #241

Closed dottodot closed 7 years ago

dottodot commented 7 years ago

I've required using

const EmailTemplate = require('email-templates').EmailTemplate;

and the following

const template = new EmailTemplate('email_templates/my_template');

gives an error of

EmailTemplate is not a constructor

v2.7.1 doesn't have this issue but I've not tried anything in-between that release and the latest one.

niftylettuce commented 7 years ago

Read the documentation please, v3 has a different API than v2.

niftylettuce commented 7 years ago

@dottodot did you see https://github.com/niftylettuce/email-templates#v3-breaking-changes yet?

dottodot commented 6 years ago

Yes sorry got it working now thanks.