Feature: add support for emailing multiple documents (#10666)

---------

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Jan Kleine
2025-10-13 22:16:43 +02:00
committed by GitHub
parent 495159f0b2
commit f0d1c75fac
14 changed files with 558 additions and 89 deletions

View File

@@ -1162,12 +1162,14 @@ def run_workflows(
else ""
)
try:
attachments = []
if action.email.include_document and original_file:
attachments = [(original_file, document.mime_type)]
n_messages = send_email(
subject=subject,
body=body,
to=action.email.to.split(","),
attachment=original_file if action.email.include_document else None,
attachment_mime_type=document.mime_type,
attachments=attachments,
)
logger.debug(
f"Sent {n_messages} notification email(s) to {action.email.to}",