Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account for MIMEBase attachments #98

Merged
merged 1 commit into from
Oct 27, 2023
Merged

account for MIMEBase attachments #98

merged 1 commit into from
Oct 27, 2023

Conversation

joshuadavidthomas
Copy link
Member

@joshuadavidthomas joshuadavidthomas commented Oct 27, 2023

It's possible to attach a MIMEBase object directly according to the Django docs:

  • attach() creates a new file attachment and adds it to the message. There are two ways to call attach():

    • You can pass it a single argument that is a MIMEBase instance. This will be inserted directly into the resulting message.

This PR accounts for that possibility when serializing an email to JSON when saving to the database.

It also removes unreachable code in the email property getter, as when the setter saves the serialized email in the database, it always saves the attachment as a dict.

@joshuadavidthomas joshuadavidthomas changed the title account for MIMEBase attachments account for MIMEBase attachments Oct 27, 2023
@joshuadavidthomas joshuadavidthomas merged commit 79a7caa into main Oct 27, 2023
25 checks passed
@joshuadavidthomas joshuadavidthomas deleted the mimebase branch October 27, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant