Skip to content

Add React Email template support via Node.js microservice#1

Open
dnplkndll wants to merge 2 commits intomasterfrom
feature/react-email-templates
Open

Add React Email template support via Node.js microservice#1
dnplkndll wants to merge 2 commits intomasterfrom
feature/react-email-templates

Conversation

@dnplkndll
Copy link

Summary

Adds React Email template support as a new template type (campaign_react) alongside existing Go templates and visual editor.

  • New react-email-service/ Node.js microservice for rendering React Email templates
  • HTTP client in Go to call the render service
  • Database migration adding campaign_react to template_type enum
  • Frontend support for selecting React templates
  • Docker Compose configuration (optional, disabled by default)

Upstream proposal: knadh#2890

Architecture

┌─────────────────────┐         ┌──────────────────────┐
│   listmonk (Go)     │  HTTP   │  React Email Service │
│                     │ ──────► │  (Node.js/Fastify)   │
│  - Campaign Manager │  POST   │                      │
│  - Template storage │ /render │  - @react-email/*    │
└─────────────────────┘         └──────────────────────┘

Files Changed

New:

  • react-email-service/ - Complete Node.js service with 3 sample templates
  • internal/reactrender/client.go - Go HTTP client
  • internal/migrations/v6.1.0.go - Database migration

Modified:

  • models/templates.go - Add TemplateTypeCampaignReact constant
  • internal/manager/manager.go - Add reactClient field
  • internal/manager/message.go - Add React rendering path
  • cmd/init.go, cmd/main.go, cmd/templates.go - Initialization and validation
  • config.toml.sample - Add [react_email] section
  • docker-compose.yml - Add optional react-email service
  • frontend/src/views/TemplateForm.vue - UI for React template selection

Test plan

  • Start react-email-service: cd react-email-service && npm run dev
  • Verify health: curl http://localhost:3001/api/health
  • Test render endpoint with sample payload
  • Configure listmonk with react_email.enabled = true
  • Create campaign with React template type
  • Send test email and verify HTML output

🤖 Generated with Claude Code

dnplkndll and others added 2 commits January 26, 2026 23:29
- Add react-email-service/ with Fastify server for rendering React Email templates
- Add campaign_react template type to PostgreSQL enum and Go models
- Add internal/reactrender HTTP client to call React Email service
- Update campaign manager to support React template rendering
- Add configuration options for react_email section in config.toml
- Update frontend TemplateForm to support React Email template type
- Update docker-compose.yml with optional React Email service

This introduces a microservice architecture for React Email, similar to the
existing email-builder pattern. Templates are defined as TSX components and
rendered to HTML via HTTP calls to the Node.js service.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add react-dom as explicit dependency to ensure it's included
in package-lock.json for npm ci in Docker builds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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