#36132: Add **kwargs to send_mail() and send_mass_mail() functions
-------------------------------------+-------------------------------------
Reporter: Nikolay Fedorov | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Core (Mail) | Version: 5.1
Severity: Normal | Resolution: wontfix
Keywords: send_email, | Triage Stage:
send_mass_mail, mail | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mike Edmunds):
If the primary request here is for the
[
https://docs.djangoproject.com/en/5.1/ref/contrib/auth/#django.contrib.auth.models.User.email_user
User.email_user()] method to accept additional arguments like `headers` or
`reply_to`, that ''might'' be a reasonable feature request. There are ways
to achieve that without changing the "frozen" mail.send_mail() API, by
updating User.email_user() from legacy send_mail() to using the newer
EmailMessage classes. (My opinion only; I don't speak for Django.)
If that's your goal, the next step would be to raise the idea in the
[
https://forum.djangoproject.com/ forum] to seek feedback. It would help
to include a concrete example of what you're trying to do (e.g., what
headers you need to add in `User.email_user()`).
Or, if the primary request here is a single statement that sends mail with
headers, you can achieve that now with the EmailMessage (or
EmailMultiAlternatives) class:
{{{#!python
EmailMessage(subject, message, from_email, to, headers={"In-Reply-To":
"..."}).send()
}}}
--
Ticket URL: <
https://code.djangoproject.com/ticket/36132#comment:5>