Skip to main content

Reports

The Reports page lets you configure automated email reports with customizable schedules, recipients, and content.

Overview

Navigate to GSM Middleware → Reports to view and configure all available reports.

Key Features:

  • 8 built-in reports covering order health, shipping, queue monitoring, and site issues
  • Configurable schedules (hourly, daily, weekly, monthly, or custom cron)
  • Per-report recipient lists and subject lines
  • Test send capability for immediate previews
  • Runs via external cron for reliability (not WordPress cron)

Permission Required: manage_options

Available Reports

ReportDescriptionDefault Schedule
Expedited ShippingDaily list of orders using expedited (non-ground) shipping methodsDaily
Orders Backed Up (Queue)Orders stuck in the processing queueHourly
Orders Backed Up (Navision)Orders waiting for Business Central importHourly
Orders Not ImportedOrders that failed to import after 24+ hoursDaily
Site IssuesSummary of sync errors across all active sitesDaily
Shipping ReportGeneral shipping activity summaryDaily
Daily ShippingDaily shipment activity and tracking updatesDaily
Failed Queue ItemsDaily summary of failed queue jobs with error detailsDaily

Interface

Report Summary Table

The main table displays all reports with:

ColumnDescription
Report NameName and brief description
ScheduleCurrent schedule (e.g., "Daily at 08:00")
RecipientsComma-separated email addresses
Last RunTimestamp of most recent execution
StatusActive (green) or Disabled (gray) badge
ActionsEdit and Test Send buttons

Editing a Report

Click Edit on any report to open the configuration modal:

Configurable Fields:

  • Recipients — Comma-separated email addresses
  • Subject Line — Email subject (supports report-specific defaults)
  • Schedule Type — Hourly, Daily, Weekly, Monthly, or Custom
  • Time of Day — Hour to send for daily/weekly/monthly (24-hour format)
  • Day of Week — For weekly schedules (Monday–Sunday)
  • Day of Month — For monthly schedules (1–28)
  • Custom Cron — Full cron expression for advanced schedules
  • Enabled — Toggle to activate/deactivate the report

Test Send

Click Test Send on any enabled report to immediately generate and email the report. This uses the current configuration and live data.

Schedule Configuration

Preset Schedules

ScheduleCron ExpressionExample
Hourly0 * * * *Every hour at :00
Daily0 8 * * *Daily at 08:00
Weekly0 8 * * 1Monday at 08:00
Monthly0 8 1 * *1st of month at 08:00

Custom Cron Expressions

For advanced schedules, use standard cron syntax:

┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *

Examples:

  • 0 6,18 * * * — Twice daily at 6 AM and 6 PM
  • 0 9 * * 1-5 — Weekdays at 9 AM
  • */30 * * * * — Every 30 minutes

External Cron Setup

Reports run via external cron, not WordPress cron. After configuring report schedules:

  1. Navigate to Tools → Crontab Generator
  2. Click Generate Crontab
  3. Copy the generated crontab entries (includes report schedules)
  4. Install on your server via crontab -e
  5. Click Mark as Installed to acknowledge

See Crontab Generator for full setup instructions.

Report Architecture

Data Flow

  1. External cron triggers cron-reports.php with the report key
  2. Report_Manager loads the report class and configuration
  3. Report generates data from database queries
  4. HTML email template renders the data
  5. Email sent to configured recipients
  6. last_run_at timestamp updated

Database

Report configurations are stored in the rm_report_configs table:

ColumnDescription
idAuto-increment primary key
report_keyUnique identifier (e.g., expedited_shipping)
nameDisplay name
descriptionBrief description of what the report covers
recipientsComma-separated email addresses
subjectEmail subject line
schedule_typehourly, daily, weekly, monthly, or custom
schedule_configJSON with schedule details (hour, day, cron expression)
is_enabledWhether the report is active
last_run_atTimestamp of last execution
settingsJSON for report-specific custom settings