fix/audit-9-4-operability #104
Reference in New Issue
Block a user
Delete Branch "fix/audit-9-4-operability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lands the user-facing half of the unsubscribe preferences work. The one-click endpoint already shipped in this PR's main commit; this adds the proactive self-service path at /dashboard/settings?tab=notifications so users don't have to wait for a mail to land before tuning their preferences. Backend ------- New EmailPreferencesController at /api/email/preferences: GET → returns one row per OPTIONAL_WORKFLOWS entry, each with current optedOut boolean (false when no DB row exists). POST → body {workflow, optedOut} flips the row; source='settings_page' captured for the audit trail. Auth+payment workflows are deliberately not exposed — the server's OPTIONAL_WORKFLOWS set stays the single source of truth. Frontend -------- Adds a 'notifications' tab to /dashboard/settings (between 'preferences' and 'security'). One toggle row per optional workflow with TR copy that explains what each mail is for. Optimistic update — switch flips instantly and reverts on failure; PostHog event captures accept/reject. Static footer note clarifies that auth + payment mail keeps coming regardless of the switches above (so users don't think they've unsubscribed from password-reset). i18n ---- Added settings.tabs.notifications + settings.notifications.{title, description} to both tr.json and en.json. Body copy is hard-coded TR (matches audit §9.3 #11 TR-only decision). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>