Download the PHP package kcs/mjml without Composer
On this page you can find all versions of the php package kcs/mjml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package mjml
mjml-php
PHP wrapper for MRML, the MJML implementation in Rust. Rust needs to be available to build this extension from source.
Building, extending PHP
PHP
Classes and Methods
The extension exposes a Mjml\Mjml
class to parse and render mjml into HTML. You can use the following methods:
public function render(string $mjml): Mjml\Email
: render a mjml string into HTMLpublic function renderFile(string $path): Mjml\Email
: read the specified file and render the mjml content into HTML (stream wrappers are supported).public static function defaultFonts(): array
: returns a hashmap with the default fonts
render
and renderFile
methods return a Mjml\Email
object which exposes the following methods:
public function getTitle(): string|null
: returns the content of the<mj-title>
tag, if setpublic function getPreview(): string|null
: returns the content of the<mj-preview>
tag, if presentpublic function getBody(): string
: returns the HTML email body
Options
While constructing the Mjml object, you can pass an array with the following options:
Option | Description | Default |
---|---|---|
disable_comments | If true, do not include comments in the HTML output | false |
social_icon_origin | Base URL for mj-social-element images | https://www.mailjet.com/images/theme/v1/icons/ico-social/ |
fonts | Key-value array of fonts used in the email body | See default fonts |
Default fonts
By default, this library uses the following fonts:
All versions of mjml with dependencies
PHP Build Version
Package Version
No informations.
The package kcs/mjml contains the following files
Loading the files please wait ....