Overview
The appointment reminders feature helps reduce no-shows by sending timely reminders to patients about their upcoming appointments. The system supports both WhatsApp and email delivery methods, allowing staff to reach patients through their preferred communication channel.Features
WhatsApp Reminders
Send instant reminders via WhatsApp Web with pre-formatted messages
Email Reminders
Compose and send email reminders directly from the system
48-Hour Window
Automatically identifies appointments in the next 48 hours
Activity Logging
Track all reminder sends with timestamp and method
How It Works
Reminder Dashboard
The reminders management interface is located at/admin/reminders and provides:
- List of confirmed appointments in the next 48 hours
- Patient contact information (phone and email)
- Quick-send buttons for WhatsApp and email
- Visual indicators for same-day and next-day appointments
/src/routes/admin/reminders/+page.svelte
Automatic Filtering
The system automatically filters appointments to show only:- Status:
confirmedappointments - Timeframe: Next 2 days (today + tomorrow)
- Contact Info: Patients with valid phone numbers or email addresses
- Active Patients: Only active patients
API Endpoints
GET /api/appointments/reminders
Retrieve list of appointments requiring reminders./src/routes/api/appointments/reminders/+server.js:5
This endpoint calls the stored procedure
sp_list_appointment_reminders() which returns appointments for the next 48 hours with confirmed status.POST /api/appointments/reminders
Log a reminder send event./src/routes/api/appointments/reminders/+server.js:21
This endpoint logs the reminder send to the audit log table for tracking purposes. The actual message delivery is handled client-side via WhatsApp Web or mailto links.
Message Templates
WhatsApp Message Format
The system generates a formatted message in Spanish:Email Format
Emails use the same message body with:- Subject: “Recordatorio de Cita Dental”
- Body: Same format as WhatsApp message
/src/routes/admin/reminders/+page.svelte:42
Delivery Methods
WhatsApp Integration
The system uses WhatsApp Web URL scheme for message delivery:
Implementation:
/src/routes/admin/reminders/+page.svelte:103
Email Integration
Email reminders use themailto: protocol:
/src/routes/admin/reminders/+page.svelte:108
User Interface
Reminder Cards
Each reminder is displayed as a card with:- Appointment Badge: Shows “Hoy” (Today) or “Mañana” (Tomorrow)
- Branch Indicator: Hospital/clinic location
- Patient Avatar: Initials of patient
- Patient Name: Full name display
- Doctor Assignment: Assigned dentist
- Contact Info: Phone and email
- Action Buttons: WhatsApp and Email send buttons
Visual Indicators
/src/routes/admin/reminders/+page.svelte:237
Stored Procedures
sp_list_appointment_reminders
Retrieves appointments needing reminders.- Patient ID, first name, last name
- Contact information (phone, email)
- Appointment date, time, and ID
- Doctor name
- Branch name
- Filtered for next 48 hours with confirmed status
Example Implementation
Activity Logging
All reminder sends are logged to thelogs table:
- user_id: Who sent the reminder
- action: “Reminder”
- entity: “Appointments”
- description: Method and appointment ID
- ip_address: Client IP
/src/routes/api/appointments/reminders/+server.js:31
Permissions
Reminder access is controlled by permissions:Required to access the reminders dashboard at
/admin/remindersRequired to send reminders via WhatsApp or email
- Admin: Full access
- Secretary: Full access
- Doctor: No access (can be granted)
Setup Instructions
Create Stored Procedure
Create the
sp_list_appointment_reminders stored procedure (see example above)Best Practices
Timing
Timing
Send reminders 24 hours before the appointment for best results. The system highlights tomorrow’s appointments with a special badge.
Contact Preferences
Contact Preferences
Some patients prefer WhatsApp while others prefer email. Always check patient preferences before sending.
Confirmation
Confirmation
The message template asks patients to confirm attendance. Follow up with patients who don’t confirm.
Batch Processing
Batch Processing
Use the “Actualizar Lista” button to refresh the list periodically throughout the day as new appointments are confirmed.
Advanced Features
Automatic Reminder System
For fully automated reminders, you can extend the system with:Implementing automated reminders requires integration with WhatsApp Business API or email service provider (e.g., SendGrid, Mailgun).
Related Features
Notifications
In-app notification system for staff alerts
Webhooks
Trigger external systems when reminders are sent
