Skip to content
A simple php library to consume use MJML rest API
Branch: master
Clone or download
Latest commit 481dd20 Sep 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src fix(): wrong return type Jun 21, 2018
.gitignore chore(): add friendsofphp/php-cs-fixer Jun 21, 2018
.php_cs.dist chore(): add friendsofphp/php-cs-fixer Jun 21, 2018
LICENSE chore(): Create composer project Jun 21, 2018
README.md docs(): Add some minimal docs Jun 21, 2018
composer.json fix(): Fix typo in composer package name Sep 13, 2018

README.md

MJML PHP

A simple php library to consume use MJML rest API

Installation

composer require juanmiguelbesada/mjml-php

How to use

<?php

use Mjml\Client;

$applicationId = '';
$secretKey = '';
$client = new Client($applicationId, $secretKey);

$mjml = '<mjml><mj-body><mj-container><mj-section><mj-column><mj-text>Hello World</mj-text></mj-column></mj-section></mj-container></mj-body></mjml>';
$message = $client->render($mjml);

$to = 'text@example.com';
$subject = 'My awesome email created with mjml';
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
mail($to, $subject, $message, $headers);
You can’t perform that action at this time.