sef-global / scholarx-backend

This is the backend of the ScholarX
MIT License
11 stars 41 forks source link

Implement Automatic remainder sending email service #177

Closed mayura-andrew closed 3 weeks ago

mayura-andrew commented 1 month ago

Purpose

The purpose of this PR is to fix #176

This issue involves enhancing the EmailReminderService to ensure that email reminders are scheduled and processed correctly, with proper handling of retries and failures.

Goals

  1. Implement a robust EmailReminderService that schedules and processes email reminders.
  2. Ensure that reminders are retried with exponential backoff in case of failures.
  3. Handle maximum retries by logging and saving failed reminders.
  4. Improve the overall reliability and maintainability of the reminder service.

Approach

  1. Added a constructor to the EmailReminders entity to initialize properties correctly.
  2. Implemented the processReminders method to handle pending reminders, including retries and exponential backoff.
  3. Added logging to track the scheduling and processing of reminders.
  4. Ensured proper transaction management in the scheduleReminders method.

Screenshots

Checklist

Related PRs

## Test environment ## Learning