[Django] #32471: Document the return value of EmailMessage.send()

26 views
Skip to first unread message

Django

unread,
Feb 21, 2021, 4:58:18 PM2/21/21
to django-...@googlegroups.com
#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.

Django

unread,
Feb 22, 2021, 12:20:41 AM2/22/21
to django-...@googlegroups.com
#32471: Document the return value of EmailMessage.send()
--------------------------------------+------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* needs_docs: 1 => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/32471#comment:1>

Django

unread,
Feb 22, 2021, 10:58:10 AM2/22/21
to django-...@googlegroups.com
#32471: Document the return value of EmailMessage.send()
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: assigned
Component: Documentation | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* owner: nobody => Hasan Ramezani
* status: new => assigned
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/14032 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32471#comment:2>

Django

unread,
Feb 23, 2021, 1:43:41 AM2/23/21
to django-...@googlegroups.com
#32471: Document the return value of EmailMessage.send()
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"b1af2cca3aba4cefc69c986d4de6cab6db524bf3" b1af2cca]:
{{{
#!CommitTicketReference repository=""
revision="b1af2cca3aba4cefc69c986d4de6cab6db524bf3"
Fixed #32471 -- Doc'd the return value of EmailMessage.send().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32471#comment:3>

Django

unread,
Feb 23, 2021, 1:44:24 AM2/23/21
to django-...@googlegroups.com
#32471: Document the return value of EmailMessage.send()
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"543171873f0565b93b3ad603fe72f92468d012a4" 5431718]:
{{{
#!CommitTicketReference repository=""
revision="543171873f0565b93b3ad603fe72f92468d012a4"
[3.2.x] Fixed #32471 -- Doc'd the return value of EmailMessage.send().

Backport of b1af2cca3aba4cefc69c986d4de6cab6db524bf3 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32471#comment:4>

Django

unread,
Feb 23, 2021, 9:22:52 AM2/23/21
to django-...@googlegroups.com
#32471: Document the return value of EmailMessage.send()
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Baptiste Mispelon):

That was fast, thanks everyone!✨

--
Ticket URL: <https://code.djangoproject.com/ticket/32471#comment:5>

Reply all
Reply to author
Forward
0 new messages