Scheduled Report Delivery Cron #
The scheduled report cron checks for due reports every hour and delivers them by email.
Schedule #
| Property | Value |
|---|---|
| WP-Cron hook | dmsi_analytics_send_scheduled |
| Frequency | Every hour |
| Handler | Scheduler::run() |
What It Does #
Each hour, the Scheduler class:
- Queries
wp_dmsilm_analytics_scheduledfor records wherenext_run <= NOW()andstatus = 'active' - For each due report: generates the report data, formats it in the configured format, emails it to recipients
- Updates
last_sentto now and calculatesnext_runfor the next delivery - On failure: increments
failure_count; if 3 consecutive failures, setsstatus = 'paused'and notifies the WordPress admin
Email Sending #
Report emails are sent using WordPress’s wp_mail() function, which uses your site’s configured SMTP or the default PHP mail. For reliable delivery of scheduled reports, configure an SMTP plugin (e.g., WP Mail SMTP) with a dedicated mail service.
