#32907: Allow duplicate headers while sending email
------------------------------------------+------------------------
Reporter: Shrawan Poudel | Owner: nobody
Type: New feature | Status: new
Component: Core (Mail) | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
Currently, for sending custom headers while sending email we create up a
dict and pass it to the **EmailMessage**
for example:
{{{
from django.core.mail import EmailMessage
email = EmailMessage(
'Example Subject',
'Here is the message.',
'[email protected]',
to=['[email protected]'],
headers={'x-unique-id': 'unique_id',
'X-email-id-trace ':'trace_id'},
)
email.send(fail_silently=False)
}}}
Since we pass **headers** using a **dict** i need to create up unique keys
for headers so this is the reason i am not being able to send duplicate
email headers,
i came across this case when i tried to implement AWS SES Logging where i
need to send multiple headers of same name like,
{{{
headers={'X-SES-CONFIGURATION-SET': 'emailLogs',
'X-SES-MESSAGE-TAGS ':'uid=uid',
'X-SES-MESSAGE-TAGS':'sub=sub',
'X-SES-MESSAGE-TAGS':'dom=dom'},
}}}
There are/can be multiple workarounds to deal with it but i will be happy
to see this implemented in django core itself
I am happy to work on it if it needs to be implemented as a new feature to
allow duplicate headers name
--
Ticket URL: <https://code.djangoproject.com/ticket/32907>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.eaf61cca9e82bf63de94d3bd8492180b%40djangoproject.com.