getHtmlFromMjml(parent::render()); } protected function getHtmlFromMjml($mjml) { $configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['mjml']); $temporaryMjmlFileWithPath = GeneralUtility::tempnam('mjml_', '.mjml'); $mjmlFile = fopen($temporaryMjmlFileWithPath, 'w'); fwrite($mjmlFile, $mjml); fclose($mjmlFile); // see https://mjml.io/download and https://www.npmjs.com/package/mjml-cli $cmd = $configuration['nodeBinaryPath'] . ' ' . $configuration['mjmlBinaryPath'] . $configuration['mjmlBinary'] .' ' . $configuration['mjmlParams'] . ' ' . $temporaryMjmlFileWithPath; $result = []; $returnValue = ''; CommandUtility::exec($cmd, $result, $returnValue); return implode('',$result); } }