MCPcopy
hub / github.com/django/django / attach_alternative

Method attach_alternative

django/core/mail/message.py:648–652  ·  view source on GitHub ↗

Attach an alternative content representation.

(self, content, mimetype)

Source from the content-addressed store, hash-verified

646 ]
647
648 def attach_alternative(self, content, mimetype):
649 """Attach an alternative content representation."""
650 if content is None or mimetype is None:
651 raise ValueError("Both content and mimetype must be provided.")
652 self.alternatives.append(EmailAlternative(content, mimetype))
653
654 def _add_bodies(self, msg):
655 if self.body or not self.alternatives:

Calls 1

appendMethod · 0.45