ADR-005: Notification Preferences

Status: Deferred Owner: @bilal @deen Date: 2025-12-06

Context

Envo sends notifications via SMS, email, and WhatsApp at various points (issue created, vendor assigned, issue completed, SLA breach). Currently no mechanism to configure channel preferences, frequency, quiet hours, or per-event opt-out.

Problems

  1. Notification fatigue — High-volume landlords get spammed
  2. Missed urgent alerts — Wrong channel, message ignored
  3. No user control — Can’t opt out of non-critical notifications
  4. Cost inefficiency — SMS when email would suffice

Decision

Deferred — Document requirements, implement when notification system is built.

Proposed Schema

  • notification_preferences — Per-user, per-org settings: default/urgent channel, digest frequency, quiet hours, event overrides (JSONB)
  • organisation_notification_defaults — Org-level defaults

Resolution Logic

  1. Check user’s preferences for this org
  2. Fall back to organisation defaults
  3. Fall back to system defaults (email normal, SMS urgent)
  4. Apply quiet hours filter
  5. If digest enabled and not urgent, queue for digest

Event Types

EventDefault ChannelUrgencyDigest-able?
issue_createdemailnormalyes
issue_status_changedemailnormalyes
vendor_assignedemailnormalyes
vendor_acceptedsmsnormalno
issue_completedemailnormalyes
sla_breachsmshighno
emergency_issuesmsurgentno

Consequences

Positive

  • Users control their notification experience
  • Cost savings (email over SMS where appropriate)
  • Supports digest for non-urgent updates

Negative

  • More complexity in notification logic
  • Users may misconfigure and miss important alerts

Risks

  • Quiet hours applied to emergencies. Mitigated by bypassing quiet hours for urgency = 'emergency'.