Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement Automatically Reminder Service #192

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

mayura-andrew
Copy link
Member

Purpose

The purpose of this PR is to fix #176

Goals

Implemented automatically monthly reminder message using CRON

Approach

Created an separate new service to send automatically reminder with cron.

Screenshots

Checklist

  • This PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.
  • I have read and understood the development best practices guidelines ( http://bit.ly/sef-best-practices )
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Related PRs

Test environment

Learning

mayura-andrew and others added 6 commits December 1, 2024 17:35
- Introduced MonthlyReminder entity and ReminderStatus enum
- Implemented ReminderCronService for scheduled reminder processing
- Updated Mentee entity to include reminders relationship
- Enhanced init-db.sh to check for existing data before seeding
- Added postgresql-client installation in Dockerfile
- Updated docker-compose.yml for SMTP_PASSWORD environment variable
- Added getReminderEmailContent utility function for email content generation
Copy link
Member

@anjula-sack anjula-sack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use an environmental variable to enable/disable this service

public start(): void {
// Run at 1 AM every day
this.cronJob = cron.schedule(
'*/2 * * * *',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use an env var to configure this.

@akshika47
Copy link
Member

Hi @mayura-andrew is there an update on this PR?

@mayura-andrew
Copy link
Member Author

Yes, I have I'll open it today.

dataSource.getRepository(Mentee),
dataSource.getRepository(CheckIn)
)
this.cronSchedule = process.env.REMINDER_CRON_SCHEDULE ?? '0 1 * * *' // Default to 1 AM every day
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.cronSchedule = process.env.REMINDER_CRON_SCHEDULE ?? '0 1 * * *' // Default to 1 AM every day
this.cronSchedule = process.env.REMINDER_CRON_SCHEDULE

if we don't have the env value let's disable the cron job

Comment on lines +18 to +19
# Cron schedule for reminders (default: "0 1 * * *" - 1 AM daily)
REMINDER_CRON_SCHEDULE="0 1 * * *"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Cron schedule for reminders (default: "0 1 * * *" - 1 AM daily)
REMINDER_CRON_SCHEDULE="0 1 * * *"
# Cron schedule for reminders (example: "0 1 * * *" - 1 AM daily)
REMINDER_CRON_SCHEDULE=

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement monthly-checking reminder service
3 participants