Closed maabiddevra closed 4 years ago
juiceResources
const Email = require('email-templates'); const email = new Email(); email .render({ path: 'mars/html', juiceResources: { preserveImportant: true, webResources: { // view folder path, it will get css from `mars/style.css` relativeTo: path.resolve('mars') } } }, { name: 'Elon' }) .then(console.log) .catch(console.error);
The example above will be useful when you have a structure like this, this will be useful when you have a separate CSS file for every template
. ├── app.js └── emails └── mars ├── html.pug ├── text.pug ├── subject.pug └── style.css
@niftylettuce Can you review this PR
v7.1.1 released to npm, thank you https://github.com/forwardemail/email-templates/releases/tag/v7.1.1
Thank you for considering.
juiceResources
in render function, with this option you don't need create Email instance every timeThe example above will be useful when you have a structure like this, this will be useful when you have a separate CSS file for every template