Setting for .eml files consumed outside of mail fetch

This commit is contained in:
shamoon
2025-01-25 21:10:08 -08:00
parent 1ac4dfce7e
commit 247d2fcae1
3 changed files with 22 additions and 1 deletions

View File

@@ -231,12 +231,16 @@ class MailDocumentParser(DocumentParser):
def generate_pdf(
self,
mail_message: MailMessage,
pdf_layout: MailRule.PdfLayout = MailRule.PdfLayout.TEXT_HTML,
pdf_layout: MailRule.PdfLayout | None = None,
) -> Path:
archive_path = Path(self.tempdir) / "merged.pdf"
mail_pdf_file = self.generate_pdf_from_mail(mail_message)
pdf_layout = (
pdf_layout or settings.EMAIL_PARSE_DEFAULT_LAYOUT
) # EMAIL_PARSE_DEFAULT_LAYOUT is a MailRule.PdfLayout
# If no HTML content, create the PDF from the message
# Otherwise, create 2 PDFs and merge them with Gotenberg
if not mail_message.html: