mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 11:51:05 -05:00
Mailjet: Prevent empty attachment filename
Mailjet requires all attachments/inlines have a non-empty Filename field. Substitute `"attachment"` for missing filenames. Fixes #407.
This commit is contained in:
@@ -195,7 +195,8 @@ class MailjetPayload(RequestsPayload):
|
||||
def add_attachment(self, attachment):
|
||||
att = {
|
||||
"ContentType": attachment.mimetype,
|
||||
"Filename": attachment.name or "",
|
||||
# Mailjet requires a non-empty Filename.
|
||||
"Filename": attachment.name or "attachment",
|
||||
"Base64Content": attachment.b64content,
|
||||
}
|
||||
if attachment.inline:
|
||||
|
||||
Reference in New Issue
Block a user