Skip to content

feat: add email feature flag, staging bypass, and postinstall#103

Merged
kevinrutledge merged 1 commit intodevelopfrom
feat/staging-deploy-readiness
Mar 28, 2026
Merged

feat: add email feature flag, staging bypass, and postinstall#103
kevinrutledge merged 1 commit intodevelopfrom
feat/staging-deploy-readiness

Conversation

@kevinrutledge
Copy link
Copy Markdown
Collaborator

@kevinrutledge kevinrutledge commented Mar 28, 2026

Developer

Kevin Rutledge

What changed?

Three changes to unblock Vercel staging deployment:

  1. EMAIL_ENABLED feature flag - email sending is now gated behind an env var (default: false). SMTP vars are optional when email is disabled. Follows the same pattern as SMS_ENABLED. Includes EMAIL_REDIRECT_TO for safe testing - when set, all emails go to that address instead of real recipients.

  2. STAGING env var - mock portal and dev token route now allow access when STAGING=true, even on production NODE_ENV. This lets the staging site use the mock portal for login since there is no real Member Portal integration.

  3. postinstall script - adds prisma generate to postinstall so Vercel regenerates the Prisma Client when restoring cached node_modules.

Also fixes deprecated React.FormEvent type in mock portal.

How to test

  1. Run npm test - 237 tests pass
  2. Run npm run build - succeeds
  3. Start dev server without SMTP vars, with EMAIL_ENABLED=false - app loads, referral form creates records without sending email
  4. Start dev server with EMAIL_ENABLED=true and EMAIL_REDIRECT_TO=your@email.com - emails redirect to that address with original recipient in subject line
  5. Set STAGING=true - /dev/mock-portal accessible regardless of NODE_ENV

Checklist

@kevinrutledge kevinrutledge requested a review from suesuee March 28, 2026 00:54
@kevinrutledge kevinrutledge self-assigned this Mar 28, 2026
@kevinrutledge kevinrutledge force-pushed the feat/staging-deploy-readiness branch from b41f414 to 431c68b Compare March 28, 2026 01:28
@hack4impact-calpoly hack4impact-calpoly deleted a comment from gitguardian bot Mar 28, 2026
@kevinrutledge kevinrutledge merged commit 2aa3fc9 into develop Mar 28, 2026
2 checks passed
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