SR
Usage

Email Reports

Send scheduled analytics summaries (with optional PDF report) to your team and clients.


Insights can deliver a recurring analytics report to a list of email recipients, perfect for keeping clients, marketing teams, or non-technical stakeholders in the loop.

The email contains an HTML summary of headline KPIs, top pages, and top referrers for the period. Optionally, the full dashboard PDF can be attached so recipients get a presentation-ready report straight in their inbox.

Note

Email delivery uses Craft's configured mailer (the same one used for password resets and other system mails).

Configuration

Open Settings → Insights → Notifications in the control panel:

SettingDescription
Email FrequencyHow often the report is sent. Never (default), Weekly, Every two weeks, or Monthly.
RecipientsOne row per email address. Each recipient gets the same report.
Attach Report PDFWhen on, attaches the full dashboard PDF to every send. Default: on.

All three settings are also available from config/insights.php — see Configuration → emailFrequency / emailRecipients / attachPdfReport.

How Scheduling Works

Insights doesn't require a cron job. The due-check piggy-backs on regular request traffic and is throttled via a cache marker so it only does real work once per hour, regardless of request volume. When the configured interval has elapsed since the last successful send, a SendNotificationReport job is pushed to the queue.

FrequencyIntervalStats range used
Weekly7 daysLast 7 days
Every two weeks14 daysLast 14 days
Monthly28 daysLast 30 days

The stats range always covers the period since the previous send, so each report describes the window between deliveries with no gaps and no overlaps.

Audit Log

Every send (and every failure) is recorded in the insights_notification_log database table along with the frequency, recipient count, status (sent / failed), and any error message. The most recent successful send timestamp is used as the gate for the next due-check, so even if traffic temporarily stops, no duplicate emails are sent when it resumes.

Send Test Mail

Below the recipients table there's a Send Test Mail button. To test current configurations don't forget to save the settings before.

Console Command

You can manually trigger a report from the CLI — useful for cron-based environments where you'd rather not rely on traffic-driven scheduling:

# Send the report for the configured frequency, but only if due
php craft insights/notifications/send

# Force a send even if the interval hasn't elapsed
php craft insights/notifications/send --force

# Send a specific frequency variant on demand
php craft insights/notifications/send --frequency=monthly --force

Available --frequency values: weekly, biweekly, monthly.

PDF Attachment

When Attach Report PDF is enabled, every email (including test mails) includes a multi-section PDF that mirrors the manual dashboard PDF export:

  • Period header with the absolute date range
  • Summary KPIs (Pageviews, Unique Visitors, Avg. Time / Page, Bounce Rate)
  • Traffic chart (pageviews + unique visitors per day)
  • Top Pages, Traffic Sources, Devices, Browsers
  • Pro tables when applicable (Top Countries, Campaigns, Events, Outbound Links, Searches, Entry/Exit Pages, Scroll Depth)

The PDF is generated on demand via dompdf at send time. If PDF rendering fails for any reason, a warning is logged and the HTML email is still delivered without the attachment.


Copyright © 2026 Samuel Reichör