# Dispatch Spot v385 — Urgent Text Opt-In and Phone Capture

> **Superseded placement note added in v391:** v385 is preserved as historical context, but its placement of phone-number capture and urgent-text opt-in controls on `/notifications` was superseded by v390. Phone capture and opt-in/out controls now belong in Workspace Settings > Notifications.

## Purpose

v385 continues the simple app-style notifications track by adding user phone-number capture and explicit urgent-text opt-in.

This keeps notifications useful without turning the Notifications page into a technical setup page.

## Product Decision

Continue notifications before returning to CORI Mail.

Reason: email delivery readiness was added in v384 and Twilio setup now belongs in Workspace Integrations. The next safe step is user-level text consent. Dispatch Spot should never send text alerts unless the user clearly opts in.

## What Changed

- Added phone-number fields to `UserNotificationPreference`.
- Added opt-in and opt-out timestamp fields.
- Updated `/notifications` with a simple urgent text alert opt-in card.
- Users can now:
  - enter a mobile number
  - agree to receive urgent Dispatch Spot text alerts
  - save urgent text opt-in
  - turn urgent text alerts off
- Updated notification delivery readiness so text alerts require:
  - user opt-in
  - saved phone number
  - Twilio setup in Workspace Integrations
- Kept Twilio account setup out of `/notifications`.

## What Stays in Workspace Settings

The following still belong in `/company/integrations`:

- Twilio account SID
- Twilio auth token
- messaging service setup
- webhook setup
- provider testing
- future text delivery setup

## User-Facing Standard

A phone number alone is not consent.

Future text sending must check for:

- saved phone number
- urgent text opt-in enabled
- opt-in timestamp present
- opt-out timestamp absent
- Twilio setup connected

## Schema Impact

v385 changes `prisma/schema.prisma`.

Run Prisma generate and db push before TypeScript and Next build.
