juamiguelbesada / mjml-php
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
一个简单的php库,用于消费MJML REST API
安装
composer require juanmiguelbesada/mjml-php
如何使用
<?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);