Releases: eprcstudio/PageMjmlToHtml
v1.3.1
v1.3.0
This new release extracts the transpiling of MJML to HTML into its own public method allowing you to call it for any arbitrary piece of MJML code, instead of having to have the code in a template file:
$mjml = "<mjml></mjml>";
/** @var PageMjmlToHtml $pmh */
$pmh = $modules->get("PageMjmlToHtml");
$result = $pmh->transpile($mjml);
if($result->code === 200 && empty($result->errors)) {
echo $result->html;
}By default the options are the one set in the module’s settings.
This new method is also hookable, which means you can for example set different options depending on the template:
$wire->addHookBefore("PageMjmlToHtml::transpile", function(HookEvent $event) {
$mjml = $event->arguments(0);
/** @var Page $page */
$page = $event->arguments(1);
$options = $event->arguments(2);
if(!$page->id || $page->template != "specific-template") return;
$options["relativeLinksParams"] = "utm_campaign=new-campaign-title";
$event->arguments(2, $options);
});v1.2.4
This new release removes the check for XML errors. This was a bad way to check for potential HTML syntax error. If the syntax error is huge enough, it should be catched up by MJML upon conversion.
A slight change was also made to the regexes for the debug’s code indentation.
v1.2.3
This new release brings a cleaner configuration page and a new ability to ignore specific relative links (anything inside href) when the "Convert relative links?" option is on.
This is useful to avoid mailing tools’ keywords (i.e. *|UNSUBSCRIBE|*) to be falsely prepended with your host.
It also comes with a few bug fixes spotted by @webmanufaktur, thanks!
v1.1.9
This release fixes a mistake from the previous one: it was calling httpUrl on a string when prepending a custom host to relative URLs.
v1.1.8
This new release brings a new option that allows to automatically convert relative urls into absolute ones. You can also choose the host to prepend or any query parameters to append.
v1.1.7
Fixed yet another issue with the minification.
Also moved back the debug markup right after <body> but this time making sure it accounts for cases where the tag has any attribute.
v1.1.6
This release adds an option to disable the minification done by the module to reduce MJML’s output size.
There’s a lot of clutter in the code sent by MJML but since the minification is pretty agressive (dumb?) it can impact the layout, if so try disabling the minification.
I also updated the french translations and pushed a few fixes.
v1.1.4
Fixed a mistake I made with the regexes used for minifying the (working) output from MJML.
v1.1.3
This releases introduces two new options:
- the ability to generate a unique output per GET variables, expect for
?rawwhich is used by the module - the ability to bypass the cache for specific roles. Useful in cases where the cache cleaning after a page save or an update to the template’s file is not enough
A notice has been added regarding the TracyDebugger module, as it hooks as well after render and might add markup to the raw code. It is advised to disable the template using No debug bar in selected frontend templates in TracyDebugger’s setting
Small fixes / cleaning have been made as well