MJML itself does not support i18n feature. This build flow will pipe MJML output html files to gulp-html-i18n to support localization.
- copy
.env.exampleto.env, and input sendgrid key forMATTERS_SENDGRID_API_KEY npm run startto start a hot-reload server to make modificationsnpm run buildfor build mjml and i18n html files without start the hot-reload servernpm run upload:devto upload build email templates to sendgrid development templatesnpm run upload:prodto upload build email templates to sendgrid production templates
- add the dynamic templates for all languages for
developmentandproductionenvironments in SendGrid - create a new mjml file in
src/templates, update, test and build - config
TEMPLATESsettings fordevelopmentandproductionenvironments insrc/updateEmailTemplates.ts
gulp-html-i18n default template render enginer uses ${{}}$ as delimiters