Open jiska78 opened 3 years ago
Hello @jiska78,
Currently, we have not implemented mime-type detection in this version of the helper library. A workaround would be to utilize the mimetypes
module, specifically mimetypes.guess_type
(reference).
I suggest we add a mimetype function to determine the mimetype and then optionally call it within the file_name
function. To make this a non-breaking change, we can add a second parameter to file_name
that defaults to false
.
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog. I will update the title for this issue accordingly.
With best regards,
Elmer
I'm using SendGrid on my website and it allows a user to attach a file to an email. I used to just have the code $email->addattachment($filename) which no longer works on the new version of SendGrid. The new format is this:
My problem with that is, how am I possibly going to know what filetype the user uploads. It could be anything? Can't I just tell sendgrid to attach whatever file is uploaded to the email being sent?