How to attach the PDF file URL with email in the mail? I’ve one pdf which is stored in the s3 bucket. The URL of that pdf file i.e https://s3-us-west-1.amazonaws.com/bucket-name/demo.pdf.
I know how to send the mail in a meteor. I know the one approach of sending pdf attachment would read file from the URL and send the read data with email as following -
Email.send({
from: `abc@gmail.com`,
to: 'cde@gmail.com',
subject: 'mySubject',
text: 'sssswwwwws',
attachments: [{'filename': 'stackoverflow23.pdf', 'content': data, 'contentType': 'application/pdf'}]
});
Here the data refer to fs.readFile(url) response.
But can we send the file URL directly with email? So we don’t need the above implementation (read file).