Skip to content

Daily CRM summary — Production Report

FieldValue
Branchfeature/daily-crm-summary
Date2026-07-23
StatusReady for GA after migrate + emails worker smoke (Critical/High audit items addressed)
ReposSaaS-Backend, SaaS-Frontend, SaaS-Docs

Summary

At workspace Daily Reminder Time (task_reminder_time, default 09:00 local), crm:send-due-notifications sends mail-only CRM snapshots in addition to the existing task due digest:

User flag receive_all_users_daily_summaryEmail
falsePersonal summary only (skipped when no open CRM work)
trueUser-wise team summary only (not both); roster includes only users with activity

Counts:

  • Leads — open stages only (exclude is_won / is_lost)
  • Tasks — open / in_progress / waiting (exclude completed / cancelled)
  • Meetings — scheduled only; distinct host or attendee (creator-only not counted)

Aggregations run once per tenant per command tick. Meeting counts use SQL COUNT(DISTINCT meeting_id).


Deploy checklist

  1. Deploy Backend + Frontend + Docs from feature/daily-crm-summary.
  2. Migrate:
    bash
    php artisan migrate --force
    • users.receive_all_users_daily_summary (default false)
    • daily_summary_deliveries (unique tenant_id, user_id, digest_date, kind)
  3. Confirm scheduler: crm:send-due-notifications every 5 minutes (withoutOverlapping, onOneServer).
  4. Confirm php artisan queue:work --queue=emails (and queue:restart after deploy).
  5. Shared cache driver required for onOneServer locks.
  6. Configure Settings → Daily Reminder Time; flag managers with Receive all-users daily summary (visibility grant — prefer Owner/Admin).
  7. Smoke:
    • Past reminder time → personal mail to unflagged user with open CRM work
    • Team mail to flagged user (only users with activity)
    • Second cron tick → no duplicate
    • Ledger queuedsent; stale queued (>45m) reclaimable (max 5 attempts)
  8. Keep scheduler + emails workers healthy through the local reminder window (no midnight catch-up).

Monitoring

SignalWhat to watch
daily_summary_deliveries.status = queued older than ~45 minutesWorker down (auto-reclaim after stale window)
attempts >= 5 still failedCap reached; investigate SMTP/queue
crm:send-due-notifications durationShould stay flat vs user count after aggregate-once fix
Emails queue depthBacklog after reminder time

Audit remediation (2026-07-23)

ItemStatus
Personal N× full-tenant scansFixed — summarizeUsers() once per tenant
Meeting PHP hydrationFixed — SQL COUNT(DISTINCT) union
Stale queued / max attemptsFixed — 45m reclaim, max 5
Team zero-activity noiseFixed — summarizeActiveUsers()
Deploy / database / Users API docsFixed
Pest gapsFixed — markSent, suspended, empty, TZ, dedupe, stale reclaim
Playwright flag toggleAdded users.daily-summary-flag.spec.ts
RBAC duplicate Edit rows + privacy noteFixed

Official documentation for the SaleOS SaaS Platform.