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.66k stars 339 forks source link

RenderAll not applying styles #371

Closed Dreamystify closed 5 years ago

Dreamystify commented 5 years ago

I have upgraded to 6.0.0 and learned I had to use renderAll to create template from multiple files. files including html.hbs, text.hbs, subject.hbs, style.hbs which worked in previous version, Im not sure why it doesn't work in the latest version

I added the following to the head section of the html.hbs file

link(rel="stylesheet", href="style.css", data-inline)

And the following is my Email config

new Email({
    views: { 
        options: { extension: 'hbs' },
        root: myTemplateDir
    },
    dkim: {
        domainName: 'example.com', 
        keySelector: 'default', 
        privateKey: dkimPrivateKey, 
        cacheDir: '/tmp', 
        cacheTreshold: 100 * 1024
    },
    juice: true,
    juiceResources: {
        preserveImportant: true,
        webResources: {
            relativeTo: myTemplateDir
        }
    }
});

Im not sure what im missing

niftylettuce commented 5 years ago

Can you make a test repository on GitHub that shows this isn't working?