Implement Automatically Reminder Service#192
Open
mayura-andrew wants to merge 9 commits intosef-global:developmentfrom
Open
Implement Automatically Reminder Service#192mayura-andrew wants to merge 9 commits intosef-global:developmentfrom
mayura-andrew wants to merge 9 commits intosef-global:developmentfrom
Conversation
- 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
anjula-sack
requested changes
Dec 21, 2024
Member
anjula-sack
left a comment
There was a problem hiding this comment.
Use an environmental variable to enable/disable this service
anjula-sack
requested changes
Jan 4, 2025
src/services/cron/reminder.cron.ts
Outdated
| public start(): void { | ||
| // Run at 1 AM every day | ||
| this.cronJob = cron.schedule( | ||
| '*/2 * * * *', |
Member
There was a problem hiding this comment.
Use an env var to configure this.
Member
|
Hi @mayura-andrew is there an update on this PR? |
Member
Author
|
Yes, I have I'll open it today. |
anjula-sack
requested changes
Feb 1, 2025
| dataSource.getRepository(Mentee), | ||
| dataSource.getRepository(CheckIn) | ||
| ) | ||
| this.cronSchedule = process.env.REMINDER_CRON_SCHEDULE ?? '0 1 * * *' // Default to 1 AM every day |
Member
There was a problem hiding this comment.
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 * * *" |
Member
There was a problem hiding this comment.
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= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Related PRs
Test environment
Learning