v5.4.0
Unified MJML Email System
Replace SendGrid dynamic templates with a unified MJML rendering pipeline. All email types (transactional, marketing, newsletter) now render server-side through the same prepare → template → MJML → HTML flow.
Highlights
- 4 composable email templates: card (default), plain (full-width), order (9 payment events), feedback (rating faces)
- Shared preparation layer (
prepare.js): brand, sender, content rendering, signoff, categories, unsubscribe URLs - Unified
data.contentcontract: all callers pass template-specific payload indata.content, system metadata injected by pipeline - UTM auto-tagging on ALL links (not just brand-domain), campaign name derived from caller categories
- Marketing campaigns: seed campaigns with CTA buttons + audience-matched discount codes, per-recipient unsubscribe via ASM tags
- Tests reorganized under
test/email/, centralized product frequency in payment journeys, test account names for personalization
Breaking (internal API)
data.body→data.contentacross all email callers and templatesdata.order→data.contentfor the order template- Marketing campaign
content/discountCode→data.content.message/data.content.discountCode - Schema defaults changed from
'default'to'card' - Template aliases (
core/card,core/order/confirmation) removed — use direct names
See CHANGELOG.md and docs/email-system.md for full details.