#32471: Document the return value of EmailMessage.send()
------------------------------------------------+------------------------
               Reporter:  Baptiste Mispelon     |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Documentation         |        Version:  master
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  1                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  1
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 The documentation for `EmailMessage.send()` [1] currently reads:
 > send(fail_silently=False) sends the message. If a connection was
 specified when the email was constructed, that connection will be used.
 Otherwise, an instance of the default backend will be instantiated and
 used. If the keyword argument fail_silently is True, exceptions raised
 while sending the message will be quashed. An empty list of recipients
 will not raise an exception.

 As a reference doc, it would be more useful if it also mentioned the
 return value of that method.

 There are two documented hints as to what the return value might be:

 * The documentation for `send_mail()` [2]:
   > The return value will be the number of successfully delivered messages
 (which can be 0 or 1 since it can only send one message).
 * The documentation for writing custom backends [3]:
   > A custom email backend must implement the
 send_messages(email_messages) method [which]  returns the number of
 successfully delivered messages.



 [1] https://docs.djangoproject.com/en/dev/topics/email/#emailmessage-
 objects
 [2] https://docs.djangoproject.com/en/dev/topics/email/#send-mail
 [3] https://docs.djangoproject.com/en/dev/topics/email/#defining-a-custom-
 email-backend

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32471>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.3dd17294040ea51a3dfcc6c93562e35a%40djangoproject.com.

Reply via email to