Notification Channel Preferences
Why it matters
Sending every notification type to every user with no opt-out mechanism violates GDPR Art. 21 (right to object to processing) and GDPR Art. 7 (conditions for consent). CCPA §1798.120 grants similar opt-out rights. Beyond compliance, a platform that ignores preferences trains users to mute or uninstall the app rather than adjusting settings — a direct retention problem. Notification preference checks must happen before dispatch, not as a post-hoc filter; dispatching a notification and suppressing delivery still constitutes processing the personal data used to trigger it.
Severity rationale
Low because the immediate harm is user experience degradation and notification fatigue, but the GDPR Art. 21 right-to-object exposure elevates the compliance risk above cosmetic severity.
Remediation
Add a NotificationPreference model to your Prisma schema and check it before dispatching any notification in your notification service.
// lib/notifications.ts
export async function sendNotification(
recipientId: string,
type: 'post_liked' | 'user_followed' | 'post_commented',
data: Record<string, unknown>
) {
const prefs = await db.notificationPreference.findUnique({
where: { userId: recipientId }
})
const gateMap = {
post_liked: prefs?.notifyOnLike ?? true,
user_followed: prefs?.notifyOnFollow ?? true,
post_commented: prefs?.notifyOnComment ?? true
}
if (!gateMap[type]) return // Preference says no: abort before any dispatch
await db.notification.create({ data: { userId: recipientId, type, payload: data } })
if (prefs?.emailEnabled ?? true) {
await sendNotificationEmail(recipientId, type, data)
}
}
Expose preference toggles in app/settings/notifications/page.tsx so users can adjust each type independently without contacting support.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Social Features & Engagement Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 21 — Right to Object
- gdpr · Art. 7 — Conditions for Consent
- ccpa · §1798.120 — Right to Opt-Out
Taxons
History
- 2026-04-18·v1.0.0·Initial import from community-social-engagement·automated