Skip to content

Releases: eprcstudio/PageMjmlToHtml

v1.3.1

09 Nov 15:57

Choose a tag to compare

It seems you cannot send an empty <mjml></mjml> tag anymore, so this new release fixes that by sending <mjml><mj-body></mj-body></mjml> instead.

v1.3.0

08 Sep 20:17

Choose a tag to compare

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

05 Apr 14:46
a678a07

Choose a tag to compare

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

12 Jun 10:03

Choose a tag to compare

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

05 Jun 12:28

Choose a tag to compare

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

20 Apr 12:59

Choose a tag to compare

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

13 Jan 11:56

Choose a tag to compare

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

11 Jan 09:57

Choose a tag to compare

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

21 Nov 22:12

Choose a tag to compare

Fixed a mistake I made with the regexes used for minifying the (working) output from MJML.

v1.1.3

12 Oct 22:29

Choose a tag to compare

This releases introduces two new options:

  • the ability to generate a unique output per GET variables, expect for ?raw which 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