Add React Email playground as email template source-of-truth - #2
Merged
Conversation
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.
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
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 withemails/newsletter.tsx(paper-style card, wavy divider, Quick Hits panel, mobile-responsive viamax-sm:*Tailwind variants) and a genericscripts/build-templates.mtsthat renders any template exportingtemplatePropsintosrc/templates/<name>.htmlsrc/utils/email_template.py— slimmed to markdown parsing + token/region filling; HTML building removedDockerfile— multi-stage: Node build stage generates templates, Python runtime stage copies them in.github/workflows/code-quality.yml—testsjob sets up Node and runsbuild:templatesbefore pytest.gitignore/.dockerignore—src/templates/*.htmlgitignored as a build artifactCLAUDE.md/README.md— updated to document the new workflowHow to test
cd email-playground && npm install && npm run dev— open localhost:3000 and confirm the ACME preview rendersnpm run build:templates— inspectsrc/templates/newsletter.htmlfor{{tokens}}and<!--#region-->markerspytest— all 84 tests passdocker build .— final image containssrc/templates/newsletter.htmlwith no Node runtime