Auto Reminders
The platform includes an automated reminder system that sends urgency-graded email notifications for MOCs with approaching or overdue target timelines.
Configuration
The auto-reminder runs as a Vercel cron job configured in vercel.json:
{
"crons": [
{
"path": "/api/auto_reminder",
"schedule": "0 8 * * *"
}
]
}
Schedule: Every day at 08:00 UTC.
Endpoint
Route: GET /api/auto_reminder
File: src/app/api/auto_reminder/route.ts
Authentication: None (public endpoint intended for cron access only).
How It Works
- Scan — Fetches all implementer form documents that have a
target-timelinefield - Filter — Skips MOCs where
completed === true - Evaluate — For each remaining MOC, calculates how the target date relates to today
- Grade — Assigns an urgency level based on the timeline
- Send — Dispatches urgency-formatted emails to all users in the MOC's
all_usersarray
Urgency Levels
| Condition | Level | Description |
|---|---|---|
| Overdue by ≤14 days | CRITICAL | Target date has passed within the last 2 weeks |
| Due tomorrow | URGENT | Target date is tomorrow |
| Due within 1 week | HIGH | Target date is within the next 7 days |
| Due within 1 month (created >30 days ago) | MEDIUM | Target date is within 30 days |
| Due within 1 month (created ≤30 days ago) | LOW | Recently created, due within 30 days |
MOCs overdue by more than 14 days are not included in reminders.
Email Content
Reminder emails include:
- The MOC serial number
- The target timeline date
- The urgency level badge
- A direct link to the MOC in the platform
- Description of what action is needed
Response
{
"message": "Reminders processed",
"totalReminders": 5,
"results": [
{
"moc_id": "...",
"serial_num": "15-2026",
"urgency": "HIGH",
"target_date": "2026-02-20",
"emailsSent": 3
}
]
}
Customizing the Schedule
To change the reminder schedule, update the schedule field in vercel.json. The cron expression follows standard cron syntax:
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *
Examples:
0 8 * * *— Daily at 08:00 UTC0 8 * * 1-5— Weekdays at 08:00 UTC0 8,14 * * *— Twice daily at 08:00 and 14:00 UTC