LastVet marketing newsletter (Cloudflare Pages Functions)¶
Public confirm and unsubscribe links for the shared marketing_* platform (product = lastvet).
Routes (production last.vet):
GET /api/newsletter/confirm?token=...GET /api/newsletter/unsubscribe?token=...POST /api/newsletter/unsubscribe-one-click?token=...
Cloudflare Pages secrets (project last-vet-web)¶
Set in Workers & Pages → last-vet-web → Settings → Environment variables (Production):
| Variable | Value |
|---|---|
ONSET_SUPABASE_URL |
Must be https://onset-api.theonset.app (or omit; code pins this origin) |
ONSET_SUPABASE_SERVICE_ROLE_KEY |
Onset sovereign service role. Required. No SUPABASE_* fallback. |
MARKETING_UNSUB_SECRET |
Optional. Must match last1-admin if set there |
C2: last.vet newsletter Functions read ONSET_SUPABASE_* only. They do not fall back to SUPABASE_*, VITE_SUPABASE_*, or LAST1ORG_DB_PROD_*. A request cannot resolve last1org-db, last1.app, hosted *.supabase.co, or LastVet API/RDS.
Leftover Pages SUPABASE_* (dead hosted exhibit) stay until C4. They are unused.
This store is not last1org-db and not LastVet API/RDS. product = lastvet rows live on onset-db.
Admin sends and sequence dispatch use the same onset-sovereign project and marketing_subscribers.product = lastvet.
Sequence dispatch¶
Queue jobs for product=lastvet are drained by the onset-web marketing dispatch cron (same Supabase project as Onset). Set LASTVET_* env vars on the onset-web Cloudflare Pages project so sequence and broadcast mail uses LastVet branding and updates@last.vet.
Until a default welcome sequence exists in admin, confirm will not enqueue sequence steps.