AAuditPro Suite· Complete manual
Complete manual Communications

Two channels

1Outbound email
PHPMailer · firm SMTP

Branded HTML emails to clients + employees. 9 lifecycle-triggered templates. Queue + delivery tracking.

2In-app notifications
Bell icon · drawer

Real-time notifications between users. 16 event types × 3 channels (in-app · email · push). Per-user preferences + quiet hours.

SMTP configuration

Settings → Communication. SMTP credentials live in config/communication.local.php (gitignored, never in DB):

System fallback: if local.php is absent, reads from system_settings. Local file is preferred for security.

The 9 templates

CodeTrigger
client.welcomeLead converted to client
client.info_requestManual
client.fieldwork_startJob → in_progress
client.report_deliveredAudit report sent
quote.sentQuote → sent
invoice.sentInvoice → sent
invoice.payment_reminderInvoice → overdue + dunning chain
payment.receivedPayment recorded
compliance.expiry_reminderDoc/visa expiring (M13/M16)

Branded HTML layout

Every email follows the same 600px-wide table layout:

Queue + cron

Emails are queued to email_queue at trigger time. cron-m17-email-queue.php processes pending queue rows every 5 minutes:

Email log

Forensic per-send record at Settings → Communication → Email Log:

500 most recent rows shown. CSV export available. Never deleted (forensic immutability).

Test mode

For sandbox testing without spamming clients:

Critical for staging. Never deploy to production with test_mode=1.

In-app notifications

NotificationService emits to user inbox + bell icon. 16 event types:

Per-user preferences at My Profile → Notification preferences: 16-event grid × 3-channel (in-app / email / push) toggles, plus quiet hours + sound + toast settings.

EventDispatcher

Single funnel for outbound triggers. 4 events wired:

All hooks are post-commit + try/catch — SMTP failures never break the upstream state machine.

Try this

Settings → Communication → Send test email. Type your own email + click. Within 5 seconds you should see it arrive. Check Email Log — your test send appears with SMTP host + Message-ID + 200 OK.

Watch out

SMTP credentials in DB are visible to super_admin via Settings → Communication. Use the local.php file pattern instead — credentials never persist in DB or git. The .example file shows the format.

Tip — DKIM + SPF for deliverability

Configure SPF + DKIM on the firm's sending domain. Without these, Gmail / Outlook may flag outbound emails as spam. Talk to your IT / hosting provider — 30 min to set up, dramatic deliverability improvement.