Ticket #11400: r11798.diff

File r11798.diff, 1.5 KB (added by John-Scott Atlakson, 15 years ago)
  • django/contrib/auth/models.py

     
    265265            m.delete()
    266266        return messages
    267267
    268     def email_user(self, subject, message, from_email=None):
     268    def email_user(self, subject, message, from_email=None, **kwargs):
    269269        "Sends an e-mail to this User."
    270270        from django.core.mail import send_mail
    271         send_mail(subject, message, from_email, [self.email])
     271        send_mail(subject, message, from_email, [self.email], **kwargs)
    272272
    273273    def get_profile(self):
    274274        """
  • docs/topics/auth.txt

     
    233233        Returns a list of :class:`~django.contrib.auth.models.Message` objects
    234234        in the user's queue and deletes the messages from the queue.
    235235
    236     .. method:: models.User.email_user(subject, message, from_email=None)
     236    .. method:: models.User.email_user(subject, message, from_email=None, **kwargs)
    237237
    238238        Sends an e-mail to the user. If
    239239        :attr:`~django.contrib.auth.models.User.from_email` is ``None``, Django
    240         uses the :setting:`DEFAULT_FROM_EMAIL`.
     240        uses the :setting:`DEFAULT_FROM_EMAIL`. Any ``**kwargs`` will be passed
     241        directly to :meth:`~django.core.mail.send_mail()`.
    241242
    242243    .. method:: models.User.get_profile()
    243244
Back to Top