Closed optikfluffel closed 3 years ago
@optikfluffel We could send multiple attachments as a list of maps (even keyword list) with keys path
& filename
def send_greetings(user, file_path) do
send_email to: user.email,
from: @from,
subject: "Happy b'day",
html: "<strong>Cheers!</strong>"
attachments: [%{path: file_path, filename: "greetings.png"}]
end
In my case I wanted to send invoice pdf on the fly in my mails to users, so didn't want to create a temporary file and send it part of the attachments
. So, did this https://github.com/vysakh0/mailgun/commit/51cf14704fa3fcf61e88c5d3331451388f982fff
@vysakh0 cool, thanks a ton, I also wanted to send something without writing it to disk first, perfect! :grin: I wonder if you should make a PR to make this a feature, I'm not sure wether we're the only ones wanting to send attachments this way or not. Any thoughts on this @chrismccord?
yes, PR please!
Thanks :+1: Done :smile: https://github.com/chrismccord/mailgun/pull/28
Anyone tried sending binary attachments, like a pdf for instance? I'm having trouble.
httpc seems stuck while trying to send a pdf. (using 0.1.2)
Hi :) It would be nice to have an example (or test case to look at) on how to send an email with some files attached.