dist/buttons/buttonApply.command.js
/**
   * Command saves the email into Database
   *
   * @param editor
   * @param sender
   */
Command saves the email into Database
@param editor
@param sender
Command saves the email into Database @param editor @param sender
static applyForm(editor, sender) {
    editor.runCommand('preset-mautic:dynamic-content-components-to-tokens');
    if (ContentService.isMjmlMode(editor)) {
      const htmlCode = MjmlService.getEditorHtmlContent(editor);
      const mjmlCode = MjmlService.getEditorMjmlContent(editor);
      if (!htmlCode || !mjmlCode) {
        throw new Error('Could not generate html from MJML');
      }
      ButtonCloseCommands.returnContentToTextarea(editor, htmlCode, mjmlCode);
    } else {
      const html = ContentService.getEditorHtmlContent(editor);
      ButtonCloseCommands.returnContentToTextarea(editor, html);
    }
    ButtonApplyCommand.postForm(editor, sender);
  }
static applyForm ( editor , sender ) { editor . runCommand ( 'preset-mautic:dynamic-content-components-to-tokens' ) ; if ( ContentService . isMjmlMode ( editor ) ) { const htmlCode = MjmlService . getEditorHtmlContent ( editor ) ; const mjmlCode = MjmlService . getEditorMjmlContent ( editor ) ; if ( ! htmlCode || ! mjmlCode ) { throw new Error ( 'Could not generate html from MJML' ) ; } ButtonCloseCommands . returnContentToTextarea ( editor , htmlCode , mjmlCode ) ; } else { const html = ContentService . getEditorHtmlContent ( editor ) ; ButtonCloseCommands . returnContentToTextarea ( editor , html ) ; } ButtonApplyCommand . postForm ( editor , sender ) ; }
Command saves the email into Database
 @param editor
 @param sender
Command saves the email into Database @param editor @param sender