Skip to content

Add React Email playground as email template source-of-truth - #2

Merged
kevinhermawan merged 1 commit into
mainfrom
feat/email-playground
Jun 18, 2026
Merged

Add React Email playground as email template source-of-truth#2
kevinhermawan merged 1 commit into
mainfrom
feat/email-playground

Conversation

@kevinhermawan

Copy link
Copy Markdown
Collaborator

Summary

Replaces hand-built inline-CSS HTML in Python with a React Email + Tailwind TypeScript project that is the visual source-of-truth for all email templates. Python is slimmed to a token-filler that reads a gitignored HTML artifact generated by the playground at CI and deploy time.

Related issues

Closes #1

Changes

  • email-playground/ — new React Email app with emails/newsletter.tsx (paper-style card, wavy divider, Quick Hits panel, mobile-responsive via max-sm:* Tailwind variants) and a generic scripts/build-templates.mts that renders any template exporting templateProps into src/templates/<name>.html
  • src/utils/email_template.py — slimmed to markdown parsing + token/region filling; HTML building removed
  • Dockerfile — multi-stage: Node build stage generates templates, Python runtime stage copies them in
  • .github/workflows/code-quality.ymltests job sets up Node and runs build:templates before pytest
  • .gitignore / .dockerignoresrc/templates/*.html gitignored as a build artifact
  • CLAUDE.md / README.md — updated to document the new workflow

How to test

  1. cd email-playground && npm install && npm run dev — open localhost:3000 and confirm the ACME preview renders
  2. npm run build:templates — inspect src/templates/newsletter.html for {{tokens}} and <!--#region--> markers
  3. From repo root: pytest — all 84 tests pass
  4. docker build . — final image contains src/templates/newsletter.html with no Node runtime

Introduces a React Email + Tailwind TypeScript project under email-playground/
that owns the newsletter design. A generic build script renders tokenized HTML
into src/templates/ (gitignored), which Python fills at send time instead of
hand-building HTML. The template is regenerated in CI and the multi-stage
Dockerfile so the runtime image always gets a fresh build.
@kevinhermawan
kevinhermawan merged commit 856e726 into main Jun 18, 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.

Add React Email playground as email template source-of-truth

1 participant