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

Attachment with stream not working on preview #383

Closed antitoine closed 4 years ago

antitoine commented 4 years ago

Hi, When I try to add an attachment to the email that comes from a stream, the attachment appears undefined in the preview in the browser (see the screenshot attached). However, when the mail is sent (I use AWS SES), the problem is not present and the attachment is correct.

Sélection_016

niftylettuce commented 4 years ago

I'm pretty sure this is due to JSON transport being the default for preview, care to submit a PR that fixes?

niftylettuce commented 4 years ago

I have just release preview-email v2.0.0 and version bumped it in email-templates, and released email-templates v7.0.0 🎉

Ref:

niftylettuce commented 4 years ago

Stream attachments should work great now @antitoine - just version bump and install latest in your project

antitoine commented 4 years ago

Hi, thank you for the fix. Indeed upgrade to v7.0.2 resolve the stream issue and the attachment is OK. But now, the promise when we call send method is never released. So I can't stay on the 7.0.2 for now...

antitoine commented 4 years ago

Maybe this need to be in another issue ?

niftylettuce commented 4 years ago

This should be fixed btw, not sure what your issues is @antitoine ?

Can you give an example? Sounds like a different problem?

sgaestel commented 4 years ago

Hi. Opened another issue for what @antitoine is describing, as facing the same issue: https://github.com/forwardemail/email-templates/issues/392

niftylettuce commented 4 years ago

See my comment here https://github.com/forwardemail/email-templates/issues/392#issuecomment-634937183.

You are using the nodemailer option incorrectly. You cannot use jsonTransport with streams. It does not support it.