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

Webpack bundling... #232

Closed LucasBrazi06 closed 7 years ago

LucasBrazi06 commented 7 years ago

Hi, I'm using webpack to bundle all my nodejs project's files in one js file. Is there a way to bundle all the email template files along it? Thanks, Serge.

LucasBrazi06 commented 7 years ago

You need a path: var template = new EmailTemplate(templateDir)

But the resource can be requested with: var template = require("ejs-compiled!./file.ejs");

see ejs-compiled-loader for webpack: https://github.com/bazilio91/ejs-compiled-loader

Is there a way to pass the template to the EmailTemplate?

LucasBrazi06 commented 7 years ago

I finally switched to a low level templating API and wrote it by myself