summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJorge C. Leitão <jorgecarleitao@gmail.com>2014-05-09 08:48:41 +0200
committerTim Graham <timograham@gmail.com>2014-06-10 14:00:52 -0400
commita00b78b1e2ac9bf271d55c1799138a27f5e0d03e (patch)
tree88c7325c2f023e3b8aa3f219c42d478720b40a47 /docs
parentd8f19bb3b6f858bef499fdab41948a5a5e8d55aa (diff)
Fixed #17431 -- Added send_mail() method to PasswordResetForm.
Credits for the initial patch go to ejucovy; big thanks to Tim Graham for the review.
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.8.txt3
-rw-r--r--docs/topics/auth/default.txt20
2 files changed, 23 insertions, 0 deletions
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index 26b9d37a88..426e03b87f 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -41,6 +41,9 @@ Minor features
:meth:`~django.contrib.auth.models.User.has_perm`
and :meth:`~django.contrib.auth.models.User.has_module_perms`
to short-circuit permission checking.
+* :class:`~django.contrib.auth.forms.PasswordResetForm` now
+ has a method :meth:`~django.contrib.auth.forms.PasswordResetForm.send_email`
+ that can be overridden to customize the mail to be sent.
:mod:`django.contrib.formtools`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt
index 3e7a49662f..b639af3b27 100644
--- a/docs/topics/auth/default.txt
+++ b/docs/topics/auth/default.txt
@@ -1205,6 +1205,26 @@ provides several built-in forms located in :mod:`django.contrib.auth.forms`:
A form for generating and emailing a one-time use link to reset a
user's password.
+ .. method:: send_email(subject_template_name, email_template_name, context, from_email, to_email, [html_email_template_name=None])
+
+ .. versionadded:: 1.8
+
+ Uses the arguments to send an ``EmailMultiAlternatives``.
+ Can be overridden to customize how the email is sent to the user.
+
+ :param subject_template_name: the template for the subject.
+ :param email_template_name: the template for the email body.
+ :param context: context passed to the ``subject_template``, ``email_template``,
+ and ``html_email_template`` (if it is not ``None``).
+ :param from_email: the sender's email.
+ :param to_email: the email of the requester.
+ :param html_email_template_name: the template for the HTML body;
+ defaults to ``None``, in which case a plain text email is sent.
+
+ By default, ``save()`` populates the ``context`` with the
+ same variables that :func:`~django.contrib.auth.views.password_reset`
+ passes to its email context.
+
.. class:: SetPasswordForm
A form that lets a user change his/her password without entering the old