mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #10863 -- Added HTML support to mail_managers() and mail_admins(), and used this to provide more and prettier detail in error emails. Thanks to boxed for the suggestion, and to Rob Hudson and Brodie Rao for their work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b407de3bc5
commit
29c4a578af
6 changed files with 103 additions and 32 deletions
|
@ -163,6 +163,12 @@ requests. These include:
|
|||
|
||||
* Support for _HTTPOnly cookies.
|
||||
|
||||
* mail_admins() and mail_managers() now support easily attaching
|
||||
HTML content to messages.
|
||||
|
||||
* Error emails now include more of the detail and formatting of
|
||||
the debug server error page.
|
||||
|
||||
.. _HTTPOnly: http://www.owasp.org/index.php/HTTPOnly
|
||||
|
||||
.. _backwards-incompatible-changes-1.3:
|
||||
|
|
|
@ -109,7 +109,7 @@ a single connection for all of its messages. This makes
|
|||
mail_admins()
|
||||
=============
|
||||
|
||||
.. function:: mail_admins(subject, message, fail_silently=False, connection=None)
|
||||
.. function:: mail_admins(subject, message, fail_silently=False, connection=None, html_message=None)
|
||||
|
||||
``django.core.mail.mail_admins()`` is a shortcut for sending an e-mail to the
|
||||
site admins, as defined in the :setting:`ADMINS` setting.
|
||||
|
@ -122,10 +122,16 @@ The "From:" header of the e-mail will be the value of the
|
|||
|
||||
This method exists for convenience and readability.
|
||||
|
||||
.. versionchanged:: 1.3
|
||||
|
||||
If ``html_message`` is provided, the resulting e-mail will be a
|
||||
multipart/alternative e-mail with ``message`` as the "text/plain"
|
||||
content type and ``html_message`` as the "text/html" content type.
|
||||
|
||||
mail_managers()
|
||||
===============
|
||||
|
||||
.. function:: mail_managers(subject, message, fail_silently=False, connection=None)
|
||||
.. function:: mail_managers(subject, message, fail_silently=False, connection=None, html_message=None)
|
||||
|
||||
``django.core.mail.mail_managers()`` is just like ``mail_admins()``, except it
|
||||
sends an e-mail to the site managers, as defined in the :setting:`MANAGERS`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue