Skip to the content.

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:

Who Can Receive Reports:

Setting Up Automated Reports

Step 1: Access Report Configuration

  1. Open BPVA Calendar app as an admin
  2. Open Admin Dashboard (hamburger menu in top-left)
  3. Tap Configuration expansion tile
  4. Tap “Automated Reporting” option

Step 2: Configure Report Settings

Enable Automated Reporting:

Select Report Types:

Set Schedule:

Add Recipients:

  1. Tap “Add Recipient”
  2. Search for user by name or email
  3. Select user from list
  4. User appears in recipients list
  5. Repeat for each person who should receive reports
  6. You can add multiple recipients

Remove Recipients:

Step 3: Save Configuration

  1. Review all settings
  2. Tap “Save Configuration”
  3. Confirmation message appears
  4. First report will be sent at the scheduled time

Step 4: Verify Reports Are Working

Check Email:

If Reports Don’t Arrive:

Understanding the Report

The daily check-in report includes:

Summary Statistics

Detailed Check-In List

For each check-in:

PDF Format

Schedule

The report function runs automatically:

Testing

Managing Reports

Changing Schedule:

  1. Go back to Automated Reporting configuration
  2. Adjust time or timezone
  3. Save configuration
  4. New schedule takes effect immediately

Adding/Removing Recipients:

Temporarily Disabling Reports:

  1. Toggle “Enable Automated Reports” to OFF
  2. Save configuration
  3. No reports will be sent
  4. Turn back ON when ready to resume

Troubleshooting

Reports Not Being Received:

PDF Won’t Open:

Empty or Missing Data:

Wrong Timezone:

Best Practices

Recipients:

Schedule:

Using Report Data:

Privacy Considerations

What’s Included:

What’s NOT Included:

Data Security:

# Using Firebase CLI
firebase functions:shell

# Then in the shell:
sendDailyCheckInReport()

Or call it from the Firebase Console:

  1. Go to Firebase Console → Functions
  2. Find sendDailyCheckInReport
  3. Click “Test function”

Check Logs

View Cloud Function logs:

firebase functions:log --only scheduledDailyCheckInReport,sendDailyCheckInReport

Troubleshooting

No Emails Being Sent

  1. Check Configuration: Verify SMTP credentials in .env file
    cd fcm_listener_function
    cat .env  # Verify credentials are set correctly
    
  2. Check if .env is deployed: The .env file must be present when deploying
    • Ensure .env exists in fcm_listener_function/ directory
    • Redeploy if you just created/updated the .env file
  3. Check if Enabled: Ensure automated reporting is enabled in the app

  4. Check Recipients: Verify recipients are configured

  5. 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:

No Check-Ins in Report

PDF Generation Fails

Check Cloud Function logs for specific PDF generation errors. Common issues:

Architecture

Flutter App Components

Cloud Function Components

Data Flow

  1. Admin configures settings in Flutter app
  2. Settings saved to Firestore app_settings/automated_reporting
  3. Cloud Function runs on schedule (6 AM daily)
  4. Function reads configuration from Firestore
  5. Queries gym_checkins collection for previous day
  6. Generates PDF report with statistics
  7. Sends email with PDF attachment to configured recipients
  8. Updates lastSent timestamp in Firestore

Cost Considerations

Cloud Functions

Email Sending

Storage

Future Enhancements

Potential improvements for future versions:

  1. Multiple Report Types: Weekly summaries, monthly analytics
  2. Custom Report Scheduling: Allow different schedules for different reports
  3. Report Customization: Let admins choose which metrics to include
  4. Historical Reports: Archive past reports in Cloud Storage
  5. Dashboard Analytics: Visual analytics in the app
  6. Export Options: CSV, Excel formats in addition to PDF
  7. Conditional Reporting: Only send if there are check-ins
  8. Report Preview: Preview report before scheduling

Support

For issues or questions:

  1. Check Cloud Function logs first
  2. Verify all configuration steps are complete
  3. Test with manual trigger before relying on schedule
  4. Review Firestore security rules for access issues