superbigco / craft-mjml

Render Twig emails with MJML.
https://superbig.co
MIT License
25 stars 5 forks source link

Add CLI config options #14

Closed mrozema closed 3 years ago

mrozema commented 3 years ago

This PR implements a method to allow the user to set any CLI command line args they would want.

Being able to produce minified HTML output from the MJML CLI is a very valuable feature. Most people will probably want to be able to produce minified code, but there are a handful of other useful config options. Rather than hardcoding the config args in the code, this lets the developers control how they want it and makes it future proof for MJML CLI config releases (i.e. it does not make any assumptions about the available config options for the CLI version that's installed).

For reference, I have a newsletter email that is 150K without minification and it is reduced to 83K when minified. This prevents it from being clipped in Gmail and is just best practice for email clients.

mrozema commented 3 years ago

Any update on this?

sjelfull commented 3 years ago

This is great, thank you!