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.67k stars 337 forks source link

How to use attachments? #272

Closed thatisuday closed 6 years ago

thatisuday commented 6 years ago

I want to send some files with the email? Where to put them?

niftylettuce commented 6 years ago

in the message object in this example you'll need to add property attachments which is an Array

https://github.com/niftylettuce/email-templates/blob/master/README.md#basic

please see Nodemailer docs at this page for more info:

https://nodemailer.com/message/attachments/

On Jan 12, 2018 5:28 AM, "Uday Hiwarale" notifications@github.com wrote:

I want to send some files with the email? Where to put them?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/niftylettuce/email-templates/issues/272, or mute the thread https://github.com/notifications/unsubscribe-auth/AAf7hbfb_e_WY4zCErLZjLdD9ahaXN3tks5tJzPegaJpZM4RcGLe .

thatisuday commented 6 years ago

@niftylettuce Thanks a lot. Great work.

thatisuday commented 6 years ago

@niftylettuce It will be great if you can update Readme regarding this

niftylettuce commented 6 years ago

Hi @thatisuday thanks for letting me know. I've done so, please see https://github.com/niftylettuce/email-templates#attachments.

If you spot any errors please advise. Thanks!

thatisuday commented 6 years ago

Great. Is there any way we can add attachments to email.send rather than new Email instance. Because, in my case attachments can vary depending on whom to send. Is there any provision for that in future release?

niftylettuce commented 6 years ago

Yes just include it in email.send not when making new Email and it will be individual

thatisuday commented 6 years ago

@niftylettuce Nodemailer attachments are working except attachment url or with href option. https://nodemailer.com/message/attachments/ Can you please check this?

thatisuday commented 6 years ago

@niftylettuce I am getting this in preview but no attachment receive when tried to send to gmail. I am using aws and cloudfront. Everything is working fine like embedded images.

image

thatisuday commented 6 years ago

Problem seems to be with nodemailer itself.

niftylettuce commented 6 years ago

okay keep posted here if you find solution, thank you

thatisuday commented 6 years ago

@niftylettuce Problem seems to be with https://github.com/orliesaurus/nodemailer-mailgun-transport/issues/16