juamiguelbesada / mjml-php
This package is abandoned and no longer maintained.
The author suggests using the juanmiguelbesada/mjml-php package instead.
A simple php library to consume use MJML rest API
v1.0.0
2018-09-13 15:47 UTC
Requires
- php: >=7.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
This package is auto-updated.
Last update: 2022-02-01 13:13:43 UTC
README
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);