Skip to content

Conversation

@Big-Lolo
Copy link
Member

This pull request introduces asynchronous, background-safe email sending for Slack invites and reminder mails, with real-time progress tracking and improved logging. The main goal is to prevent request timeouts and provide clients with immediate feedback while email jobs run in the background. It also adds endpoints to monitor the progress of these background jobs and enhances logging for mail operations.

The most important changes are:

Background email sending and progress tracking:

  • Added background task support for Slack invite and reminder mail endpoints in router_v1.py, allowing these emails to be sent asynchronously and immediately returning a response to the client. Also added a new endpoint to check send progress for a given event. [1] [2]
  • Implemented job tracking in EventService with thread-safe methods to start, increment, and finish email sending jobs, and a method to retrieve progress (including estimated time remaining).
  • Added send_slack_mail_background and send_reminder_mails_background methods in EventService that create independent DB sessions for safe background execution, send emails with optional throttling delay, and update progress tracking. [1] [2]

API and logic improvements:

  • The reminder mail field order was corrected to match expected template input.

Logging improvements:

  • Replaced print statements with structured logging in MailClient for mail creation and sending, improving observability and debugging. [1] [2] [3] [4]

@Big-Lolo Big-Lolo merged commit 7cc19b0 into main Nov 19, 2025
5 of 7 checks passed
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.

2 participants