1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Improve documentation

This commit is contained in:
Pascal F 2024-05-24 07:36:53 +02:00
parent bb924f1f4d
commit 7337d3130e
No known key found for this signature in database
GPG key ID: 3C576B538F890866
2 changed files with 23 additions and 15 deletions

View file

@ -654,9 +654,16 @@ class Message(models.Model):
to retrieve that information through normal channels, so we must
pre-set it.
For conveninence, you can use django.core.mail.EmailMessage to build a Message instance::
from django.core.mail import EmailMessage
message.reply(
EmailMessage(subject="pong", body="pongpong")
)
"""
if not isinstance(message, EmailMessage):
raise ValueError('Message must be an instance of EmailMessage')
raise ValueError('Message must be an instance of email.Message')
if not message.from_email:
if self.mailbox.from_email: