Automated Daily Check-In Reports
Overview
The Automated Daily Check-In Report feature sends professional email reports with PDF attachments summarizing gym check-ins from the previous day. Reports are automatically delivered every morning at 6 AM Eastern Time to selected admin and coach users.
What You’ll Get:
- Daily email with PDF attachment
- Check-in statistics (total check-ins, unique users, average distance)
- Detailed check-in list with timestamps and athlete names
- Professional formatting with BPVA branding
Who Can Receive Reports:
- Administrators
- Coaches
- Receptionists
- Any combination of staff members you select
Setting Up Automated Reports
Step 1: Access Report Configuration
- Open BPVA Calendar app as an admin
- Open Admin Dashboard (hamburger menu in top-left)
- Tap Configuration expansion tile
- Tap “Automated Reporting” option
Step 2: Configure Report Settings
Enable Automated Reporting:
- Toggle “Enable Automated Reports” to ON
- The system is now active and will send reports daily
Select Report Types:
- Currently supports: Daily Check-In Report
- Check the box to enable this report type
- Future: Additional report types may be added
Set Schedule:
- Time: Choose when reports should be sent (default: 6:00 AM)
- Timezone: Select your facility’s timezone (default: America/New_York - Eastern)
- Reports cover check-ins from the previous day
Add Recipients:
- Tap “Add Recipient”
- Search for user by name or email
- Select user from list
- User appears in recipients list
- Repeat for each person who should receive reports
- You can add multiple recipients
Remove Recipients:
- Tap the X next to any recipient’s name to remove them
- Changes take effect immediately
Step 3: Save Configuration
- Review all settings
- Tap “Save Configuration”
- Confirmation message appears
- First report will be sent at the scheduled time
Step 4: Verify Reports Are Working
Check Email:
- Wait for scheduled report time
- Check email inbox (and spam folder)
- Look for email from BPVA Calendar system
- Open PDF attachment to view report
If Reports Don’t Arrive:
- Verify you’re in the recipients list
- Check spam/junk folder
- Ensure email address in your profile is correct
- Contact system administrator
Understanding the Report
The daily check-in report includes:
Summary Statistics
- Total check-ins for the day
- Number of unique users
- Average distance from gym location
Detailed Check-In List
For each check-in:
- Time of check-in
- User name
- User email
- Distance from gym (in meters)
PDF Format
- Professional layout with BPVA branding
- Tabular format for easy reading
- Timestamp of report generation
- Organized by check-in time
Schedule
The report function runs automatically:
- Time: 6:00 AM Eastern Time (configurable in the app UI)
- Frequency: Daily
- Report Date: Previous day’s check-ins
- Cloud Function:
scheduledDailyCheckInReport
Testing
Managing Reports
Changing Schedule:
- Go back to Automated Reporting configuration
- Adjust time or timezone
- Save configuration
- New schedule takes effect immediately
Adding/Removing Recipients:
- Changes take effect for the next scheduled report
- No need to restart or redeploy anything
- Recipients receive reports until removed from list
Temporarily Disabling Reports:
- Toggle “Enable Automated Reports” to OFF
- Save configuration
- No reports will be sent
- Turn back ON when ready to resume
Troubleshooting
Reports Not Being Received:
- Check spam/junk email folder
- Verify recipient email address is correct in user profile
- Ensure you’re in the recipients list
- Check that automated reporting is enabled
- Verify scheduled time hasn’t passed today
- Contact system administrator if issue persists
PDF Won’t Open:
- Try different PDF reader (Adobe Acrobat, Preview, browser)
- Download attachment rather than opening in email
- Check file isn’t corrupted (re-send if needed)
- Ensure device has PDF reader installed
Empty or Missing Data:
- Report covers PREVIOUS day’s check-ins, not current day
- If no check-ins yesterday, report will show zero
- Check that gym check-in feature is working correctly
- Verify athletes are actually checking in
Wrong Timezone:
- Update timezone in report configuration
- Report times will adjust to new timezone
- Check-in timestamps in report match gym’s timezone
Best Practices
Recipients:
- Include all coaches who need daily attendance info
- Add facility manager for oversight
- Include receptionist if they handle attendance
- Limit to staff who actually need the data
Schedule:
- 6 AM is good for morning review before practice
- Adjust if you have early morning sessions
- Consider staff work schedules
- Keep timezone updated if facility moves
Using Report Data:
- Review daily to spot attendance trends
- Follow up with athletes who haven’t checked in
- Use stats for membership engagement
- Archive reports for historical records
- Compare week-to-week for growth tracking
Privacy Considerations
What’s Included:
- Check-in times and dates
- Athlete names and emails
- Distance from gym (to verify location)
- Aggregate statistics
What’s NOT Included:
- Exact athlete GPS locations
- Personal medical information
- Payment information
- Private athlete notes
Data Security:
- Reports sent via secure email
- PDF files not publicly accessible
- Only designated recipients receive reports
- Athlete data handled per privacy policy
# Using Firebase CLI
firebase functions:shell
# Then in the shell:
sendDailyCheckInReport()
Or call it from the Firebase Console:
- Go to Firebase Console → Functions
- Find
sendDailyCheckInReport - Click “Test function”
Check Logs
View Cloud Function logs:
firebase functions:log --only scheduledDailyCheckInReport,sendDailyCheckInReport
Troubleshooting
No Emails Being Sent
- Check Configuration: Verify SMTP credentials in
.envfilecd fcm_listener_function cat .env # Verify credentials are set correctly - Check if .env is deployed: The
.envfile must be present when deploying- Ensure
.envexists infcm_listener_function/directory - Redeploy if you just created/updated the
.envfile
- Ensure
-
Check if Enabled: Ensure automated reporting is enabled in the app
-
Check Recipients: Verify recipients are configured
- Check Logs: Look for errors in Cloud Function logs
firebase functions:log --only scheduledDailyCheckInReport
Gmail “Less Secure App” Error
If using Gmail and seeing authentication errors:
- Make sure you’re using an App Password (not your regular password)
- Enable 2-Step Verification first
- Generate a new App Password specifically for this function
No Check-Ins in Report
- The report only includes check-ins from the previous day
- Verify check-ins exist in the
gym_checkinsFirestore collection - Check that the date range is correct
PDF Generation Fails
Check Cloud Function logs for specific PDF generation errors. Common issues:
- Insufficient memory (may need to upgrade Cloud Function tier)
- Large number of check-ins (may need pagination)
Architecture
Flutter App Components
automated_reporting_screen.dart: Admin UI for configuring reportsreport_configuration_service.dart: Service for managing Firestore configuration- Firestore Collection:
app_settings/automated_reporting
Cloud Function Components
daily_checkin_report.ts: Core report generation logicscheduledDailyCheckInReport: Scheduled function that runs dailysendDailyCheckInReport: Callable function for manual triggers
Data Flow
- Admin configures settings in Flutter app
- Settings saved to Firestore
app_settings/automated_reporting - Cloud Function runs on schedule (6 AM daily)
- Function reads configuration from Firestore
- Queries
gym_checkinscollection for previous day - Generates PDF report with statistics
- Sends email with PDF attachment to configured recipients
- Updates
lastSenttimestamp in Firestore
Cost Considerations
Cloud Functions
- Scheduled invocation: ~30 times/month (daily)
- Execution time: ~5-10 seconds per report
- Memory: 256 MB (default) should be sufficient for most use cases
Email Sending
- Free tier: Most SMTP providers offer free tiers for low volume
- Gmail: Free for reasonable volume (hundreds per day)
- SendGrid: Free tier includes 100 emails/day
Storage
- PDF generation is in-memory (not stored in Cloud Storage)
- No additional storage costs
Future Enhancements
Potential improvements for future versions:
- Multiple Report Types: Weekly summaries, monthly analytics
- Custom Report Scheduling: Allow different schedules for different reports
- Report Customization: Let admins choose which metrics to include
- Historical Reports: Archive past reports in Cloud Storage
- Dashboard Analytics: Visual analytics in the app
- Export Options: CSV, Excel formats in addition to PDF
- Conditional Reporting: Only send if there are check-ins
- Report Preview: Preview report before scheduling
Support
For issues or questions:
- Check Cloud Function logs first
- Verify all configuration steps are complete
- Test with manual trigger before relying on schedule
- Review Firestore security rules for access issues