Conversation
|
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stackoverflow-email ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…mail # Conflicts: # package-lock.json
…mail # Conflicts: # package-lock.json
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.
STACKS-905
Introduces
@stackoverflow/stacks-email, a new (experimental) MJML powered email package for building, previewing, documenting, and compiling Stack Overflow email templates.stacks-docsBackground
Historically, Stack Overflow's email design system lived across several separate implementations, including the monolith and external marketing tools. Since 2020, the system has had limited modernization or maintenance.
This work is part of the 2026 rebrand rollout. The goal is to create a shared source of truth for email design patterns, implementation, previewing, and downstream consumption.
We selected MJML because it is widely adopted, MIT licensed, and abstracts much of the client-specific complexity of writing production email HTML.
Overview
Components
~/packages/stacks-email/componentsAdds reusable email building blocks such as
Button,Header,Footer,Cardetc. Each defines their variants, options, tokens, and MJML render output in one place.Templates
~/packages/stacks-email/templatesAdds example and reusable template definitions including
Transactional,Newsletter,Promotional. These compose components into full MJML documents and can expose variants and props.Compile APIs
The package can be consumed in several ways:
@stackoverflow/stacks-emailPOST /api/compileThe package API and HTTP API intentionally serve different use cases.
The package API is the full in-process integration surface for trusted TypeScript consumers. It supports catalog discovery, component compilation, template compilation, renderable dispatch, and lower-level MJML compilation primitives.
The HTTP endpoint is a narrower service integration surface. It currently focuses on composing transactional emails from a validated JSON block list, then returning compiled MJML and HTML. This keeps the cross-service contract small while still enabling non-TypeScript consumers to generate branded email output without embedding the package.
Documentation
Adds a new Email section to
stacks-docs, including:Usage
As a package
As an endpoint
As static docs artifacts
@stackoverflow/stacks-email/sveltekitexports route handlers used bystacks-docsto serve precompiled email HTML, MJML, and manifest data.Compile targets
Every compile supports a target:
preview: replaces tokens with sample valuesdotnet: replaces tokens with Razor model bindingsbraze: replaces tokens with Braze/Liquid-style valuesThis allows the same email source to produce output for different downstream systems.
Notes for reviewers
Suggested review path:
packages/stacks-email/README.mdpackages/stacks-email/componentspackages/stacks-email/templatespackages/stacks-email/src/lib/pipelinepackages/stacks-email/src/lib/apipackages/stacks-email/src/routes/api/compile/+server.tspackages/stacks-docs/src/components/StacksEmailEmbed.sveltepackages/stacks-docs/src/routes/email/compiledCurrent limitations / Follow-ups