Skip to content

feat(orgs): ORG_CREATE_NOTIFY_ADDR override for org-lifecycle notifications#524

Merged
mikestankavich merged 1 commit into
mainfrom
feat/org-create-notify-addr
Jul 21, 2026
Merged

feat(orgs): ORG_CREATE_NOTIFY_ADDR override for org-lifecycle notifications#524
mikestankavich merged 1 commit into
mainfrom
feat/org-create-notify-addr

Conversation

@mikestankavich

Copy link
Copy Markdown
Contributor

Problem

Org create, delete, and self-service signup notifications fan out to every active superadmin, in every environment. In preview that means the e2e org-creation firehose pages all superadmins with test-org noise — Tim got preview test-org create notes and asked "what is this?"

Change

New email.OrgNotifyOverride(): when ORG_CREATE_NOTIFY_ADDR is set, all three superadmin org-lifecycle notifications route to that single address instead of the superadmin fan-out (and the superadmin DB lookup is skipped entirely). Unset — the default, including prod — keeps the existing all-superadmins behavior byte-for-byte.

Set ORG_CREATE_NOTIFY_ADDR=<your-addr> in the preview environment and the churn goes only to you; Tim and everyone else stop getting it. Prod leaves it unset.

Touched paths

  • email/resend.goOrgNotifyOverride() helper (env read, trimmed, empty = unset)
  • orgs/service.gonotifySuperadmins (covers create + delete) honors the override
  • auth/auth.gonotifyTrialSignup (self-service signup) honors the override

Notes / decisions

  • Scope: the single var governs all three org-lifecycle notices, not just admin-create — that's what actually silences the preview firehose (self-service signup is the high-volume path). Named per your suggestion; say the word if you'd rather it be create-only or renamed (e.g. ORG_NOTIFY_ADDR) to reflect the delete coverage.
  • Behavior when unset is unchanged; no prod impact until the var is set in preview.

Tests

  • email unit TestOrgNotifyOverride — unset/whitespace → nil, set/trimmed → single (no DB) ✅
  • integration override cases for create, delete, and signup assert single-recipient (sent == 1 with two superadmins seeded); existing fan-out + nil-client tests still green ✅

🤖 Generated with Claude Code

…ations

Org create/delete/self-service-signup notifications fan out to every active
superadmin in every environment. In preview that means the e2e org-creation
firehose pages all superadmins (Tim, etc.) with test-org noise.

Add email.OrgNotifyOverride(): when ORG_CREATE_NOTIFY_ADDR is set, all three
superadmin org-lifecycle notifications go to that single address instead of the
superadmin fan-out (and the superadmin lookup is skipped). Unset — the default,
including prod — keeps the existing all-superadmins behavior unchanged.

Set it to one operator address in preview to silence the churn for everyone else.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment Update

✅ This PR has been successfully merged into the preview branch.

The preview environment will update shortly at: https://app.preview.trakrf.id

@mikestankavich
mikestankavich merged commit c8ff5a7 into main Jul 21, 2026
15 checks passed
@mikestankavich
mikestankavich deleted the feat/org-create-notify-addr branch July 21, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant