Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def send_email(
subject: str,
body: str,
html_body: str,
submission_id: int,
reply_to_emails: Optional[list[str]] = None,
) -> None:
"""Send a plain-text and HTML email via the Halon SMTP relay."""
Expand Down Expand Up @@ -44,9 +45,12 @@ def send_email(
bcc_emails = []

#build email
thread_root = f"<moderation-submit-{submission_id}@arxiv.org>"
msg = email.message.EmailMessage()
msg["Date"] = format_datetime(localtime())
msg["Message-ID"] = make_msgid()
msg["In-Reply-To"] = thread_root
msg["References"] = thread_root
msg["From"] = settings.MAIL_FROM
msg["To"] = ", ".join(to_emails)
msg["Subject"] = subject
Expand Down
1 change: 1 addition & 0 deletions app/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def _send_email_tasks(
subject=subject,
body=body_text,
html_body=body_html,
submission_id=task.submission_id,
reply_to_emails=task.reply_to_emails,
)
ack_fn(task.notifications.ack_ids) # ack only after successful send
Expand Down
Loading