Setup Email - NowStack Mobile
<objective>
Configure a deployment-specific verified sender and prove a real transactional email from the actual Better Auth/Convex path.
</objective>
<required_reads>
Read convex/auth.ts, convex/emailActions.ts, convex/emailTemplates.ts, convex/siteConfig.ts, site-config.ts, and .agents/rules/auth-payments-storage.md before editing.
</required_reads>
<workflow>
- Choose development or production explicitly. Never copy a dev API key into production.
- Confirm the sender domain and From address belong to the product. Obtain DNS values from Resend and present exact records; DNS mutation needs separate authorization.
- Create a least-privilege deployment-specific Resend key. Read it silently and set it through stdin:
read -rsp "Resend API key: " RESEND_API_KEY; echo
printf '%s' "$RESEND_API_KEY" | npx convex env set <optional --prod> RESEND_API_KEY
unset RESEND_API_KEY
printf '%s' 'Product <hello@example.com>' | npx convex env set <optional --prod> EMAIL_FROM
- Wait for provider DNS verification and read it back. Do not claim propagation from local DNS alone.
- Trigger email OTP through the real signed-out app/web flow to a controlled inbox. Verify provider event, Convex logs, inbox delivery, links/code, sender, subject, and no secret/PII logging.
- Run
ns-check-setupfor the target deployment.
</workflow>
<boundaries>
App Review credentials are a separate private no-delivery path and must not reuse an email delivery key. Production proof without Resend/provider access is NOT VERIFIABLE.
</boundaries>