Skip to content

Options

Configuration accepted by mjmlI18nextCompiler(options).

  • templatesDir (string, required): Absolute path to templates directory.
  • partialsDir (string): Absolute path to Handlebars partials directory.
  • mjmlOptions (object): Options passed to mjml() (e.g., { validationLevel: 'soft' }).
  • localesDir (string, default "locales"): Base path to the locales folder.
  • defaultLocale (string, default "en"): Fallback language.
  • preload (string[]): Locales to preload.
  • namespaces (string[], default ["common"]): i18next namespaces.
  • defaultNamespace (string, default "common"): Default i18next namespace.
  • autoSubject (boolean, default true): Enable auto-subject using <subjectNamespace>:<template>.subject.
  • subjectNamespace (string, default "emails"): Namespace used for auto-subject key lookup.
  • force (boolean, default false): Recompile even if mail.data.html exists.
  • strict (boolean, default false): Throw on MJML errors; otherwise attach mail.data.mjmlErrors.
  • helpers (Record): Additional Handlebars helpers.
  • i18next (i18n): Pre-initialized instance; if provided, the FS backend is not added by the plugin.

TypeScript users can import MjmlI18nextOptions from the package.