juanmiguelbesada / mjml-php
A simple php library to consume use MJML rest API
Installs: 37 693
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 0
Forks: 2
Open Issues: 2
Requires
- php: >=7.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
This package is auto-updated.
Last update: 2024-11-14 06:23:51 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);