12 — Notification Configs
What it is: Per-program settings that control which notifications fire and how they're configured. The purchase flow uses three keys (below), each enable/disable-able independently; NotificationKey also defines six payment_plan_* keys (reminder/success/failure × text/email) that use this same table but are dispatched by Cortex.
Table: tbl_notification_configs
One row per (programId, notificationKey) combination.
| Field | Notes |
|---|---|
programId | FK to tbl_flex_programs |
notificationKey | which notification (see types below) |
isEnabled | default false — notifications are opt-in |
value | JSONB — channel-specific config (templates, recipients, etc.) |
Notification types
| Key | Who receives it | Notes |
|---|---|---|
purchase_text | Fan | purchase-confirmation SMS — static per-client { message }, sent for every order |
purchase_buyer_email | Fan | sender name/email, subject, color, static custom text only — no personalization tokens |
purchase_client_email | Team/client | "account X bought at time Y" notification |
Payment-plan notifications use the same table (the six
payment_plan_*keys inNotificationKey) but are dispatched by the Cortex cron (cortex-backend notifications module), not by this backend.
Key rules
- All notifications default to disabled
- Buyer email supports only static text — no
{{name}},{{event}}merge fields - One config per key per program (unique constraint enforced)
- Write operations from dashboard only — this backend is read