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

Changing the folder for saving previews does not work #389

Closed operari closed 4 years ago

operari commented 4 years ago

Hello!

A path to a directory for saving the generated email previews not working. How to change the path?

preview: { dir: path.resolve('.') }

niftylettuce commented 4 years ago

Can you share debug output?

DEBUG=preview-email node app.js

It should output both the options and the file path it's writing to.

operari commented 4 years ago

Debugging does not show the path.

{ envelope: { from: 'niftylettuce@gmail.com', to: [ 'elon@spacex.com' ] }, messageId: '<2618e894-ac71-d19a-b14b-7e55b544826f@gmail.com>', message: '{"to":[{"address":"elon@spacex.com","name":""}],"from":{"address":"niftylettuce@gmail.com","name":""},"attachments":[],"subject":"Hi David Swith, welcome to Mars","html":"some html","text":"some text","headers":{},"messageId":"<2618e894-ac71-d19a-b14b-7e55b544826f@gmail.com>"}', originalMessage: { to: 'elon@spacex.com', from: 'niftylettuce@gmail.com', attachments: [], subject: 'Hi David Swith, welcome to Mars', html: 'some html', text: ' some text' } }

I deleted the markup...

niftylettuce commented 4 years ago

Are you on the latest versions of everything?

See https://github.com/forwardemail/preview-email/blob/master/src/index.js#L52 as it outputs a filePath string in debug output.

operari commented 4 years ago

I had a 5.0.4 version of the repository. Update helped. Thank's, awesome repo!