Org audience mass-email + org-level read-only viewer role - #51
Merged
Merged
Conversation
Org audience / mass email:
- Connect each project's backing DB (Supabase via service-role auth.users or
a public table; Turso via @libsql/client read-only SELECT) as a per-org data
source, sync every user email into a deduped org audience, and blast it
through the org's existing SMTP/Resend sender config.
- Always adds one-click unsubscribe + List-Unsubscribe headers and skips both
per-org unsubscribes and globally-unsubscribed marketing_contacts.
- Fix: an explicit "resend" org sender config is no longer hijacked by a global
SMTP_HOST env (sendOutreachEmail now honors the provider choice).
- Migration 20260611140000_org_audience.sql; new lib/audience/*; dashboard
panels; tests for connector normalization + query guard.
Org-level viewer role:
- Read-only org members ("viewer"): see every project in the org but cannot
mutate any project or org data. Reads widened in is_org_wide_member +
is_project_member; writes unchanged (is_org_owner / is_project_editor still
owner/member only). Migration 20260611150000_org_member_viewer_role.sql.
- Team-members panel gets a Member/Read-only invite dropdown, a
"Make read-only / Make editor" toggle, and viewer badges; role carried
through organization_invitations.role and applied on accept.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two features, both tested green (typecheck,
next build, 327 tests).1. Org audience mass-email
auth.usersor a public table) or Turso (@libsql/client, read-onlySELECT, guarded).List-Unsubscribeheaders; skips per-org unsubscribes and globally-unsubscribedmarketing_contacts.resendorg sender config is no longer hijacked by a globalSMTP_HOSTenv./unsubscribe/org/[token], and connector tests.20260611140000_org_audience.sql2. Org-level read-only "viewer" role
is_org_wide_member+is_project_memberwidened) but write nothing (is_org_owner/is_project_editorunchanged).organization_invitations.roleand applied on accept.20260611150000_org_member_viewer_role.sqlMigrations
Both migrations have already been applied to the hosted Supabase project (
supabase db push), so they're live on the shared DB.Test plan
tsc --noEmit: cleannext build: compiled successfullyvitest run: 327 passed / 7 skipped🤖 Generated with Claude Code