I'm trying to pull a public AWS file and use it as an attachment, like so:
attachments['file.zip'] = open('https://s3.amazonaws.com/file.zip')
I'm getting a No such file or directory
I've changed the paths above to be generic, but I can indeed navigate to the AWS path and get a file. Is there a way to make it an attachement for use by ActionMailer?
attachments['file.zip'] = open('https://s3.amazonaws.com/file.zip').read
open
returns an IO object, not the content of the file. You must give the file content to attachments
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With