MJML in PHP =========== A simple PHP library to render MJML to HTML. There are two ways for integrating MJML in PHP: * using the MJML API * using the MJML library ### Installation ```shell script composer require qferr/mjml-php ``` ### Using MJML library Install the MJML library: ```shell script npm install mjml --save ``` If you want a specific version, use the following syntax: `npm install mjml@4.7.1 --save` ```php render(' Hello world '); ``` ### Using MJML API ```php render(' Hello world '); ``` To find out which version of the library is used by the API, check the `mjml_version` key in the payload returned by the API: ``` { "html": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Hello World
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ", "errors": [], "mjml": "Hello World", "mjml_version": "4.6.1" } ``` More details in the API documentation: https://mjml.io/api/documentation/