https://github.com/qferr/mjml-php
  
  
    A simple PHP library to render MJML to HTML. 
    https://github.com/qferr/mjml-php
  
email mjml mjml-api php
        Last synced: 3 days ago 
        JSON representation
    
A simple PHP library to render MJML to HTML.
- Host: GitHub
- URL: https://github.com/qferr/mjml-php
- Owner: qferr
- Created: 2020-04-02T16:45:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-16T19:32:56.000Z (over 1 year ago)
- Last Synced: 2024-10-20T09:18:21.586Z (about 1 year ago)
- Topics: email, mjml, mjml-api, php
- Language: PHP
- Homepage: https://qferrer.medium.com/rendering-mjml-in-php-982d703aa703
- Size: 55.7 KB
- Stars: 67
- Watchers: 1
- Forks: 9
- Open Issues: 5
- 
            Metadata Files:
            - Readme: README.md
 
Awesome Lists containing this project
README
          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
                
            
        
    
');
```
You can get the version of MJML used by the API to transpile:
```php
$api->getMjmlVersion();
```
More details in the API documentation: [https://mjml.io/api/documentation](https://mjml.io/api/documentation)