Skip to content

Prevent Repetitive Mail Sending for Completed POTD #1

@Rajat069

Description

@Rajat069

Currently, the bot sends reminder emails multiple times even after a user has completed the LeetCode Problem of the Day (POTD).
This can lead to spammy notifications and redundant communication.

Expected Behavior:

Once a user successfully completes the POTD, the bot should send the “Congratulations” email only once for that day, and skip any further reminders until the next day’s problem is released.

Steps to Reproduce:

  1. Add a user in users.json who completes the POTD.
  2. Wait for the bot’s next scheduled run.
  3. Observe that the bot sends multiple reminder/congrats emails even after completion.

Proposed Solution:

  • Track each user’s daily completion status using a temporary flag or cache (e.g., in-memory dictionary or local JSON).
  • Before sending an email, check if the user has already been marked as “completed” for the current date.
  • Reset completion flags at midnight (IST/UTC).

Acceptance Criteria:

✅ Only one “Congratulations” email is sent per user per day.
✅ No further reminders sent after completion.
✅ Flags reset correctly for the next day’s POTD.

Environment:

Docker container or local dev
Python 3.10+

Deployed on: GHCR

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions