diff options
| author | VIZZARD-X <vigneshanandmay13@gmail.com> | 2026-07-10 21:46:16 +0530 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2026-10-01 11:36:13 -0300 |
| commit | 80ea222c8af501031b2eae4f7d9fdbf16cb507a7 (patch) | |
| tree | cc613b1df06f20f62204133980186ff676725e64 /docs/ref | |
| parent | 23e8bcc464e5faefec28bf36a2f4610a5e7f4be5 (diff) | |
Fixed #37167 -- Allowed email.headerregistry.Address objects as email addresses.
Address is the safe way to build an email address with a display name
from variable parts (see #34753), but `ADMINS` and `MANAGERS` rejected
non-string values, so it could not be used there. This branch allows
`Address` instances in those settings, documents, and tests the support
already present in `DEFAULT_FROM_EMAIL`, `SERVER_EMAIL`, `send_mail()`,
`send_mass_mail()`, and `EmailMessage`.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/settings.txt | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 304bb75ca3..674f676013 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -52,14 +52,17 @@ A list of all the people who get code error notifications. When is configured in :setting:`LOGGING` (done by default), Django emails these people the details of exceptions raised in the request/response cycle. -Each item in the list should be an email address string. Example:: +Each item in the list should be an email address string or +:class:`~email.headerregistry.Address` object. Example:: ADMINS = ["john@example.com", '"Ng, Mary" <mary@example.com>'] To safely build an address with a display name from variable content, see -:ref:`formatting-addresses`, which recommends using -:class:`~email.headerregistry.Address` over string formatting, but since this -setting requires a list of strings, wrap each ``Address`` in ``str(...)``. +:ref:`formatting-addresses`. + +.. versionchanged:: 6.2 + + Support for :class:`~email.headerregistry.Address` objects was added. .. setting:: ALLOWED_HOSTS @@ -1359,6 +1362,10 @@ This doesn't affect error messages sent to :setting:`ADMINS` and To build an address with a display name from variable content, see :ref:`formatting-addresses`. +.. versionchanged:: 6.2 + + Support for :class:`~email.headerregistry.Address` objects was added. + .. setting:: DEFAULT_INDEX_TABLESPACE ``DEFAULT_INDEX_TABLESPACE`` @@ -2250,6 +2257,10 @@ A list in the same format as :setting:`ADMINS` that specifies who should get broken link notifications when :class:`~django.middleware.common.BrokenLinkEmailsMiddleware` is enabled. +.. versionchanged:: 6.2 + + Support for :class:`~email.headerregistry.Address` objects was added. + .. setting:: MEDIA_ROOT ``MEDIA_ROOT`` @@ -2818,6 +2829,10 @@ To build an address with a display name from variable content, see regular email messages sent with :func:`~django.core.mail.send_mail` come from; for that, see :setting:`DEFAULT_FROM_EMAIL`. +.. versionchanged:: 6.2 + + Support for :class:`~email.headerregistry.Address` objects was added. + .. setting:: SHORT_DATE_FORMAT ``SHORT_DATE_FORMAT`` |
