PHP code example of zellien / zellien-mjml
1. Go to this page and download the library: Download zellien/zellien-mjml library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zellien / zellien-mjml example snippets
$mjmlTemplate = '<mjml>Your MJML template goes here</mjml>';
$renderedHtml = $renderer->render($mjmlTemplate);
try {
$renderedHtml = $renderer->render($mjmlTemplate);
} catch (BadRequestException $e) {
// Handle bad request error
} catch (UnauthorizedException $e) {
// Handle unauthorized error
} catch (ForbiddenException $e) {
// Handle forbidden error
} catch (UnexpectedErrorException $e) {
// Handle unexpected error
}