Notifications & Templates
Account includes a full multi-channel transactional notification engine shared by your application code and sibling modules such as Payments, Commerce, and Packages.
Supported Channels
Section titled “Supported Channels”| Channel Key | Transport / Storage | Notes |
|---|---|---|
email |
ProcessWire WireMail |
Localized subject, HTML body, and plain-text fallback. |
sms |
Pluggable SMS driver (log default) |
Register custom gateways via $account->notifications()->registerSmsDriver(). |
webhook |
WireHttpTransport (SSRF-hardened) |
Signed with HMAC X-Account-Signature header; blocks private/loopback IP ranges. |
in_app |
entries_tbl_account_inbox |
Persists per-user alerts queried via $account->inbox()->unreadCount() and markAllRead(). |
Custom channels and recipient resolvers can also be registered via registerChannel() and registerTargetResolver().
12 Built-In Starter Templates
Section titled “12 Built-In Starter Templates”Account seeds 12 editable templates in account-templates on installation:
security-otp-alertaccount-activitypayment-receiptpayment-refundpayment-failedsubscription-activatedsubscription-invoice-paidsubscription-payment-failedsubscription-canceledorder-confirmationcommerce-abandoned-cartsystem-health-alert
Sending, Previewing & Queueing
Section titled “Sending, Previewing & Queueing”<?php namespace ProcessWire;
$account = Account::requireInstance($wire);$notifications = $account->notifications();
// Render subject and body without dispatching$preview = $notifications->preview('payment-receipt', [ 'locale' => 'en', 'data' => ['reference' => 'CHR-2026-104', 'amount' => 'EUR 4,900.00'],]);
// Respect global dispatch mode (sync or queued via SendNotificationQueue)$notifications->send('account-activity', [ 'user' => $user, 'email' => $user->email, 'data' => ['member_name' => 'Claire Beaumont', 'activity' => 'Berth confirmed'],]);
// Force immediate synchronous dispatch or explicit background queue$notifications->sendNow('security-otp-alert', ['email' => $user->email, 'data' => ['code' => '482910']]);$notifications->queue('order-confirmation', ['user' => $user, 'data' => ['order_no' => 'AV-9012']]);Templates can attach declarative ConditionRuleEvaluator rules so a channel only fires when runtime payload fields match (for example, sending an SMS alert only when amount_minor >= 500000).
In-App Inbox & Deterministic Testing
Section titled “In-App Inbox & Deterministic Testing”<?php namespace ProcessWire;
// Read and clear a member's in-app inbox$unread = $account->inbox()->unreadCount((int) $user->id);$account->inbox()->markAllRead((int) $user->id);
// Deterministic test fake (zero external emails, SMS, or webhooks sent)$account->fakeNotifications();
// ... run application code under test ...$account->assertNotificationSent('account-activity', fn (array $record): bool => $record['channel'] === 'email');$recorded = $account->recordedNotifications();$account->clearNotificationFake();