Closed ghost closed 7 years ago
I've reproduced your issue and implementing a patch now.
Please download v3.1.0 via npm install email-templates@latest
or yarn add email-templates@latest
, thank you for reporting this core bug. cc @mycompassspins
@niftylettuce Thanks for looking into that! I was able to get attachments to send via email, but I had to remove the content
property from each attachment. Is that expected behavior?
Also, while the attachments are rendered fine via email, they do not render in the preview. Is that also expected?
@mycompassspins I'm looking into this now
I don't think you need to specify content if you also specify path? https://nodemailer.com/message/attachments/
Could you write a test case that fails?
also I'm fixing preview-email
right now per https://github.com/nodemailer/nodemailer/issues/799, this will get released shortly
@mycompassspins here's a preview for you of preview-email@0.0.3
which is now available in email-templates@3.1.4
. the links for attachments are clickable and have data-uri inlining so you can test opening your attachments as well.
@niftylettuce Thanks for the work! So far I have not been able to write a test that fails, but I'm still determined ;)
Hi there,
I'm working on upgrading to v3, and have everything working except message attachments. Given an attachments array on the message object that looks something like:
And a message object that looks something like:
With the above,
Email.send
returnsundefined
. If I remove themessage.attachments
property, everything works great. Ahhhh, what am I missing?!Update
If I manually call
email.render
and add my attachments to the message object after rendering, I can at least see that SOMETHING is happening.The above at least produces an acknowledgement that the attachment SHOULD have been sent. The preview contains this link. It sounds like the nodemailer author fixed this in version 4.1.1, but I'm running
nodemailer@4.2.0
.Update 2
I've confirmed that the issue is not with the nodemailer package. Given the above configuration of the message object,
transport.sendMail(message)
works as expected (attachments attached). NeitherpreviewMail(message)
noremail.send(message, locals)
produce the attachments.