Skip to content

feat: add local MJML renderer using spatie/mjml-php - #89

Closed
MelvinAchterhuis wants to merge 3 commits into
FriendsOfShopware:mainfrom
MelvinAchterhuis:feature/local-mjml-renderer
Closed

feat: add local MJML renderer using spatie/mjml-php#89
MelvinAchterhuis wants to merge 3 commits into
FriendsOfShopware:mainfrom
MelvinAchterhuis:feature/local-mjml-renderer

Conversation

@MelvinAchterhuis

Copy link
Copy Markdown
Member

Summary

  • Extracts MJML rendering into a strategy pattern (MjmlRendererInterface) so the rendering backend is swappable
  • Adds LocalMjmlRenderer using spatie/mjml-php for local Node.js-based MJML compilation
  • Existing shyim.de API renderer (ApiMjmlRenderer) remains the default — fully backwards compatible
  • Configurable via bundle config: mjml_renderer: local to opt-in to local rendering

Configuration

# config/packages/frosh_platform_template_mail.yaml
frosh_platform_template_mail:
    mjml_renderer: local  # default: api

Requires Node.js 16+ and the mjml npm package when using local mode.

Test plan

  • Existing API renderer tests pass (migrated to ApiMjmlRendererTest)
  • New LocalMjmlRendererTest passes with spatie/mjml-php
  • MjmlLoaderTest updated to test file reading and include parsing independently
  • Tested end-to-end: switched to local mode, triggered mail send, verified HTML output in Mailpit
  • Verified api mode (default) still works identically

🤖 Generated with Claude Code

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