Documentation Index
Fetch the complete documentation index at: https://docs.traza.com.au/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This feature automatically sends reminder emails to customers 48 hours before their confirmed tattoo appointments.How It Works
Scheduled Function
- Schedule: Daily at 9:00 AM Sydney time
- Function:
scheduled.sendBookingReminders - Logic: Checks for
CONFIRMEDbookings happening in 2 days and sends reminder emails
Email Template
- Template:
BookingReminderEmail.tsx - Content: Appointment details, preparation tips, booking management link
- Style: Follows existing email template design
Database Updates
- New Fields: Added to
BookingConfirmedtype:reminderEmailSent?: booleanreminderEmailSentAt?: number
Implementation Details
Files Created/Modified
-
Types:
types/models/bookings.ts- Added reminder tracking fields
-
Email Template:
functions/emails/templates/BookingReminderEmail.tsx- New template
-
Email Function:
functions/src/email/sendBookingReminder.ts- Email sending logic
-
Scheduled Function:
functions/src/scheduled/sendBookingReminders.ts- Main scheduled job
-
Functions Index:
functions/src/index.ts- Export new scheduled function
Dependencies Added
date-fns-tz- For proper timezone handling
Deployment
Prerequisites
- Ensure Mailgun is properly configured
- Set
FRONTEND_URLenvironment variable for booking links - Verify Firebase Functions permissions for Pub/Sub
Deploy Commands
Testing
Local Testing
Email Preview
Monitoring
Logs
- Check Cloud Functions logs for execution results
- Monitor success/failure rates
- Track email delivery via Mailgun dashboard
Alerts
Consider setting up Cloud Monitoring alerts for:- Function execution failures
- High email failure rates
- Function timeout issues
Configuration
Timezone
- All operations use Sydney timezone (
Australia/Sydney) - Handles DST automatically
Reminder Timing
- Sends reminders exactly 48 hours before appointments
- Only processes
CONFIRMEDbookings - Prevents duplicate emails with tracking flags
Future Enhancements
- Multiple reminder types (24h, 2h before)
- User preference for reminder timing
- SMS reminders
- Artist notification preferences