Skip to content

Commit e183d6c

Browse files
Mridul Dhallfelixxm
authored andcommitted
Fixed #36597 -- Corrected directives for functions from email module in docs.
Thanks Mike Edmunds for the report.
1 parent 8956ee3 commit e183d6c

7 files changed

Lines changed: 23 additions & 23 deletions

File tree

docs/ref/contrib/auth.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ Methods
294294

295295
Sends an email to the user. If ``from_email`` is ``None``, Django uses
296296
the :setting:`DEFAULT_FROM_EMAIL`. Any ``**kwargs`` are passed to the
297-
underlying :meth:`~django.core.mail.send_mail` call.
297+
underlying :func:`~django.core.mail.send_mail` call.
298298

299299
Manager methods
300300
---------------

docs/ref/django-admin.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,12 +1052,12 @@ together:
10521052
.. django-admin-option:: --managers
10531053

10541054
Mails the email addresses specified in :setting:`MANAGERS` using
1055-
:meth:`~django.core.mail.mail_managers`.
1055+
:func:`~django.core.mail.mail_managers`.
10561056

10571057
.. django-admin-option:: --admins
10581058

10591059
Mails the email addresses specified in :setting:`ADMINS` using
1060-
:meth:`~django.core.mail.mail_admins`.
1060+
:func:`~django.core.mail.mail_admins`.
10611061

10621062
``shell``
10631063
---------

docs/ref/settings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2656,7 +2656,7 @@ protocol.
26562656
.. admonition:: Why are my emails sent from a different address?
26572657

26582658
This address is used only for error messages. It is *not* the address that
2659-
regular email messages sent with :meth:`~django.core.mail.send_mail`
2659+
regular email messages sent with :func:`~django.core.mail.send_mail`
26602660
come from; for that, see :setting:`DEFAULT_FROM_EMAIL`.
26612661

26622662
.. setting:: SHORT_DATE_FORMAT

docs/releases/1.2.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ of an SMTPConnection::
878878
messages = get_notification_email()
879879
connection.send_messages(messages)
880880

881-
...should now call :meth:`~django.core.mail.get_connection` to
881+
...should now call :func:`~django.core.mail.get_connection` to
882882
instantiate a generic email connection::
883883

884884
from django.core.mail import get_connection
@@ -900,7 +900,7 @@ SMTP connection::
900900

901901
If your call to construct an instance of ``SMTPConnection`` required
902902
additional arguments, those arguments can be passed to the
903-
:meth:`~django.core.mail.get_connection` call::
903+
:func:`~django.core.mail.get_connection` call::
904904

905905
connection = get_connection(
906906
"django.core.mail.backends.smtp.EmailBackend", hostname="localhost", port=1234

docs/releases/1.3.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ requests. These include:
292292

293293
* Support for HttpOnly_ cookies.
294294

295-
* :meth:`~django.core.mail.mail_admins` and
296-
:meth:`~django.core.mail.mail_managers` now support easily attaching
295+
* :func:`~django.core.mail.mail_admins` and
296+
:func:`~django.core.mail.mail_managers` now support easily attaching
297297
HTML content to messages.
298298

299299
* :class:`~django.core.mail.EmailMessage` now supports CC's.

docs/releases/1.7.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ Minor features
422422

423423
* Any ``**kwargs`` passed to
424424
:meth:`~django.contrib.auth.models.User.email_user` are passed to the
425-
underlying :meth:`~django.core.mail.send_mail` call.
425+
underlying :func:`~django.core.mail.send_mail` call.
426426

427427
* The :func:`~django.contrib.auth.decorators.permission_required` decorator can
428428
take a list of permissions as well as a single permission.

docs/topics/email.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ can be ``0`` or ``1`` since it can only send one message).
133133
(subject, message, from_email, recipient_list)
134134

135135
``fail_silently``, ``auth_user``, ``auth_password`` and ``connection`` have the
136-
same functions as in :meth:`~django.core.mail.send_mail`. They must be given
136+
same functions as in :func:`~django.core.mail.send_mail`. They must be given
137137
as keyword arguments if used.
138138

139139
Each separate element of ``datatuple`` results in a separate email message.
140-
As in :meth:`~django.core.mail.send_mail`, recipients in the same
140+
As in :func:`~django.core.mail.send_mail`, recipients in the same
141141
``recipient_list`` will all see the other addresses in the email messages'
142142
"To:" field.
143143

@@ -169,12 +169,12 @@ The return value will be the number of successfully delivered messages.
169169
``send_mass_mail()`` vs. ``send_mail()``
170170
----------------------------------------
171171

172-
The main difference between :meth:`~django.core.mail.send_mass_mail` and
173-
:meth:`~django.core.mail.send_mail` is that
174-
:meth:`~django.core.mail.send_mail` opens a connection to the mail server
175-
each time it's executed, while :meth:`~django.core.mail.send_mass_mail` uses
172+
The main difference between :func:`~django.core.mail.send_mass_mail` and
173+
:func:`~django.core.mail.send_mail` is that
174+
:func:`~django.core.mail.send_mail` opens a connection to the mail server
175+
each time it's executed, while :func:`~django.core.mail.send_mass_mail` uses
176176
a single connection for all of its messages. This makes
177-
:meth:`~django.core.mail.send_mass_mail` slightly more efficient.
177+
:func:`~django.core.mail.send_mass_mail` slightly more efficient.
178178

179179
``mail_admins()``
180180
=================
@@ -248,7 +248,7 @@ scripts generate.
248248
The Django email functions outlined above all protect against header injection
249249
by forbidding newlines in header values. If any ``subject``, ``from_email`` or
250250
``recipient_list`` contains a newline (in either Unix, Windows or Mac style),
251-
the email function (e.g. :meth:`~django.core.mail.send_mail`) will raise
251+
the email function (e.g. :func:`~django.core.mail.send_mail`) will raise
252252
:exc:`ValueError` and, hence, will not send the email. It's your responsibility
253253
to validate all data before passing it to the email functions.
254254

@@ -291,18 +291,18 @@ from the request's POST data, sends that to admin@example.com and redirects to
291291
The ``EmailMessage`` class
292292
==========================
293293

294-
Django's :meth:`~django.core.mail.send_mail` and
295-
:meth:`~django.core.mail.send_mass_mail` functions are actually thin
294+
Django's :func:`~django.core.mail.send_mail` and
295+
:func:`~django.core.mail.send_mass_mail` functions are actually thin
296296
wrappers that make use of the :class:`~django.core.mail.EmailMessage` class.
297297

298298
Not all features of the :class:`~django.core.mail.EmailMessage` class are
299-
available through the :meth:`~django.core.mail.send_mail` and related
299+
available through the :func:`~django.core.mail.send_mail` and related
300300
wrapper functions. If you wish to use advanced features, such as BCC'ed
301301
recipients, file attachments, or multi-part email, you'll need to create
302302
:class:`~django.core.mail.EmailMessage` instances directly.
303303

304304
.. note::
305-
This is a design feature. :meth:`~django.core.mail.send_mail` and
305+
This is a design feature. :func:`~django.core.mail.send_mail` and
306306
related functions were originally the only interface Django provided.
307307
However, the list of parameters they accepted was slowly growing over
308308
time. It made sense to move to a more object-oriented design for email
@@ -675,7 +675,7 @@ It can also be used as a context manager, which will automatically call
675675
Obtaining an instance of an email backend
676676
-----------------------------------------
677677

678-
The :meth:`get_connection` function in ``django.core.mail`` returns an
678+
The :func:`get_connection` function in ``django.core.mail`` returns an
679679
instance of the email backend that you can use.
680680

681681
.. function:: get_connection(backend=None, *, fail_silently=False, **kwargs)
@@ -756,7 +756,7 @@ The file backend writes emails to a file. A new file is created for each new
756756
session that is opened on this backend. The directory to which the files are
757757
written is either taken from the :setting:`EMAIL_FILE_PATH` setting or from
758758
the ``file_path`` keyword when creating a connection with
759-
:meth:`~django.core.mail.get_connection`.
759+
:func:`~django.core.mail.get_connection`.
760760

761761
To specify this backend, put the following in your settings::
762762

0 commit comments

Comments
 (0)