src/mjml/mjml.service.js
/**
   * Transform MJML to HTML
   * @todo show validation erros in the UI
   * @returns string
   */
Transform MJML to HTML
@todo show validation erros in the UI
@returns string
Transform MJML to HTML @todo show validation erros in the UI @returns string
static mjmlToHtml(mjml) {
    try {
      if (typeof mjml !== 'string' || !mjml.includes('<mjml>')) {
        throw new Error('No valid MJML provided');
      }
      return mjml2html(mjml, { beautify: true });
    } catch (error) {
      console.warn(error);
      return null;
    }
  }
static mjmlToHtml ( mjml ) { try { if ( typeof mjml !== 'string' || ! mjml . includes ( '<mjml>' ) ) { throw new Error ( 'No valid MJML provided' ) ; } return mjml2html ( mjml , { beautify : true } ) ; } catch ( error ) { console . warn ( error ) ; return null ; } }
Transform MJML to HTML
 @todo show validation erros in the UI
 @returns string
Transform MJML to HTML @todo show validation erros in the UI @returns string
// html needs to be beautified for the click tracking to work. // strict mode not working with e.g. id="" and data-type parameters that // are e.g. used for Dynamic Content