Download the PHP package kachar/zend-mjml without Composer
On this page you can find all versions of the php package kachar/zend-mjml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kachar/zend-mjml
More information about kachar/zend-mjml
Files in kachar/zend-mjml
Package zend-mjml
Short Description MJML Client
License MIT
Homepage https://github.com/kachar/zend-mjml
Informations about the package zend-mjml
ZF2 Module for MJML to HTML rendering
This module is based on: MJML The only open-source framework that makes responsive-email easy https://mjml.io
With this module you can define your email templates as MJML files and render them using Zend ViewModel
.
The MJML markup will be sent to https://mjml.io/try-it-live in order to be transformed to HTML.
The package supports:
- simple variable replacement after the markup has been converted. (
*.mjml
files) - complex templating system using PHP inside the mjml markup. (
*.pmjml
files)
You can send the complete emails using a pre-defined email transport method.
Requirements
- PHP Version >= 5.4
- Zend Framework 2 (2.*)
- Guzzle Http Client (~5)
- Guzzle Cache Subscriber (*)
Installation
-
Add
"kachar/zend-mjml": "dev-master"
to yourcomposer.json
file and runphp composer.phar update
. - Add
ZendMjml
to yourconfig/application.config.php
file under themodules
key.
Configuration
Under the key mjml
you can set the following options in the configuration:
mjmlServiceUrl
:
Sets the MJML endpoint (default https://mjml.io
)
timeout
:
Float describing the timeout of the request in seconds. Use 0 to wait indefinitely (default value 10
).
connectTimeout
:
Float describing the number of seconds to wait while trying to connect to a server. Use 0 to wait indefinitely (default value 1.5
).
transportAdapter
:
The adapter that will be used to send the actual email. Two possible configurations:
-
as a string - Any service that implements
Zend\Mail\Transport\TransportInterface
and can be fetched from ServiceLocator. - as factory array - Configuration options based on
\Zend\Mail\Transport\Factory
. For advanced factory options you can see (official documentation)[http://framework.zend.com/manual/current/en/modules/zend.mail.transport.html#zend-mail-transport].
Usage
Inline MJML makrup
Using ViewModel that loads MJML makrup file
Using ViewModel that loads PHP-MJML makrup file
All versions of zend-mjml with dependencies
zendframework/zendframework Version 2.*
guzzlehttp/guzzle Version ~5
guzzlehttp/cache-subscriber Version *