summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-06-20 10:49:56 +0200
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-06-21 09:43:10 +0200
commit7a0cd09f9f85f55fdc2b3fe63bea94b21e31d3c2 (patch)
treee02d55973a569a3a2780ca4ba9982a6d8d212730 /docs
parent20c2d625d3d5062e43918d1d7b6f623202491dd4 (diff)
Cleaned up EmailMultiAlternatives docs.
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/email.txt44
1 files changed, 21 insertions, 23 deletions
diff --git a/docs/topics/email.txt b/docs/topics/email.txt
index 1a283bdbb4..635864a95e 100644
--- a/docs/topics/email.txt
+++ b/docs/topics/email.txt
@@ -397,11 +397,27 @@ Django's email library, you can do this using the
.. class:: EmailMultiAlternatives
- A subclass of :class:`~django.core.mail.EmailMessage` that allows
- additional versions of the message body in the email via the
- ``attach_alternative()`` method. This directly inherits all methods
- (including the class initialization) from
- :class:`~django.core.mail.EmailMessage`.
+ A subclass of :class:`EmailMessage` that allows additional versions of the
+ message body in the email via the :meth:`attach_alternative` method. This
+ directly inherits all methods (including the class initialization) from
+ :class:`EmailMessage`.
+
+ .. attribute:: alternatives
+
+ A list of named tuples with attributes ``(content, mimetype)``. This is
+ particularly useful in tests::
+
+ self.assertEqual(len(msg.alternatives), 1)
+ self.assertEqual(msg.alternatives[0].content, html_content)
+ self.assertEqual(msg.alternatives[0].mimetype, "text/html")
+
+ Alternatives should only be added using the :meth:`attach_alternative`
+ method.
+
+ .. versionchanged:: 5.2
+
+ In older versions, ``alternatives`` was a list of regular tuples,
+ as opposed to named tuples.
.. method:: attach_alternative(content, mimetype)
@@ -420,24 +436,6 @@ Django's email library, you can do this using the
msg.attach_alternative(html_content, "text/html")
msg.send()
- .. attribute:: alternatives
-
- A list of named tuples with attributes ``(content, mimetype)``. This is
- particularly useful in tests::
-
- self.assertEqual(len(msg.alternatives), 1)
- self.assertEqual(msg.alternatives[0].content, html_content)
- self.assertEqual(msg.alternatives[0].mimetype, "text/html")
-
- Alternatives should only be added using the
- :meth:`~django.core.mail.EmailMultiAlternatives.attach_alternative`
- method.
-
- .. versionchanged:: 5.2
-
- In older versions, ``alternatives`` was a list of regular tuples, as opposed
- to named tuples.
-
Updating the default content type
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~