Skip to content

feat(email): branded React Email magic-link template - #5

Merged
Codehagen merged 4 commits into
mainfrom
feat/react-email-magic-link
Apr 17, 2026
Merged

Codehagen merged 4 commits into
mainfrom
feat/react-email-magic-link

Conversation

@Codehagen

Copy link
Copy Markdown
Owner

Summary

  • Replaces the plain-text sign-in email with a React Email HTML template that matches the site's editorial-technical aesthetic
  • Wordmark (the "?" square from the site header), near-black primary CTA, cool-neutral palette, 10-min expiry copy, tuned plain-text fallback
  • pnpm -F web email spins up the local React Email preview at port 3001
  • Hosted-only — scaffolded projects don't ship emails/ or @react-email/components

Files

  • apps/web/emails/sign-in-magic-link.tsx — new component + PreviewProps
  • apps/web/lib/auth.ts — deliverMagicLink() now passes react: to Resend; plain-text fallback kept explicit. MAGIC_LINK_EXPIRES_MINUTES constant keeps the plugin's expiry and the email copy in sync.
  • apps/web/package.json — @react-email/components (dep), react-email (dev), email script
  • scripts/sync-templates.mjs — emails/ added to HOSTED_TIER_EXCLUDES

Design notes

  • Can't use Geist fonts in email (no reliable @font-face support across clients) — system-font stack instead, same tracking
  • Can't use shadcn oklch tokens (zero email-client support) — hardcoded hex approximations in the @/emails Tailwind config
  • Table-based wordmark so Outlook doesn't mangle alignment
  • box-border on the CTA button per React Email guidance

Test plan

  • Typecheck clean
  • 51 web tests pass
  • sync:templates --dry-run confirms emails/ excluded (33 hosted files skipped, was 32)
  • Vercel preview deploy green
  • Local preview: pnpm -F web email → http://localhost:3001 renders the template
  • End-to-end: sign out of helpbase.dev, run helpbase login --email you@x.com, confirm email renders correctly in inbox
  • Confirm text fallback renders in a plain-text-only client (e.g. curl-style view in Gmail source)

🤖 Generated with Claude Code

Replaces the plain-text sign-in email with a React Email component
that matches the site's editorial-technical aesthetic: helpbase
wordmark ("?" square + wordmark), near-black primary CTA, cool-
neutral palette, Geist-ish system-font stack (Geist doesn't render
reliably across email clients), 10-min expiry copy, hairline
divider, footer with helpbase.dev link.

- apps/web/emails/sign-in-magic-link.tsx: new component with
  PreviewProps for `pnpm -F web email` preview. Table-based
  wordmark so Outlook doesn't mangle alignment. Hardcoded hex
  approximations of the shadcn oklch tokens (oklch doesn't render
  in email clients).
- apps/web/lib/auth.ts: Better Auth's magic-link sender now passes
  `react:` to Resend. Plain-text fallback is kept explicit (tuned
  copy, not a stripped-down HTML dump). `MAGIC_LINK_EXPIRES_MINUTES`
  constant keeps the plugin's `expiresIn` and the email copy in
  sync.
- apps/web/package.json: `@react-email/components` as dep;
  `react-email` as dev dep for local preview; `pnpm -F web email`
  script.
- scripts/sync-templates.mjs: add `emails/` to HOSTED_TIER_EXCLUDES
  so scaffolded projects don't drag in @react-email/components.
- CHANGELOG: unreleased entry.

Typecheck clean. 51 web tests pass. Scaffolder dry-run confirms
emails/ is excluded (33 hosted-tier files skipped, up from 32).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
helpbase Ready Ready Preview, Comment Apr 17, 2026 7:15pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 17, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Codehagen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 50 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 18 minutes and 50 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7a74bf33-d005-47f9-8abb-97042a44e6e1

📥 Commits

Reviewing files that changed from the base of the PR and between e769fa1 and 5ddf636.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • CHANGELOG.md
  • DESIGN.md
  • apps/web/components/header.tsx
  • apps/web/emails/sign-in-magic-link.tsx
  • apps/web/lib/auth.ts
  • apps/web/package.json
  • apps/web/public/r/help-center.json
  • packages/create-helpbase/templates/components/header.tsx
  • registry/helpbase/components/header.tsx
  • scripts/sync-templates.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/react-email-magic-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Codehagen and others added 2 commits April 17, 2026 21:11
Removes the bg-foreground "?" square from both the site header and
the magic-link email wordmark. DESIGN.md updated to reflect.

- apps/web/components/header.tsx: logo is now the plain "helpbase"
  Link, no icon container or hidden-on-mobile breakpoint needed
- apps/web/emails/sign-in-magic-link.tsx: wordmark Section is now
  a single Text node, drops the wordmark table
- DESIGN.md: header left-side description updated

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Required by `pnpm -F web email` — the React Email CLI renders
templates through this runtime. Caught on first run of the
preview server.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Re-runs pnpm sync:templates after the header.tsx edit so the
scaffolded project templates and the shadcn registry output match
apps/web. Drift gate caught this on the first CI run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Codehagen
Codehagen merged commit 42b3785 into main Apr 17, 2026
5 checks passed
@Codehagen
Codehagen deleted the feat/react-email-magic-link branch April 17, 2026 19:19

This branch was successfully deployed

1 active deployment
Preview — 5ddf6367 Deployed Apr 17, 2026 by vercel[bot]
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