Download the PHP package mistralys/mailcode without Composer
On this page you can find all versions of the php package mistralys/mailcode. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mistralys/mailcode
More information about mistralys/mailcode
Files in mistralys/mailcode
Download mistralys/mailcode
More information about mistralys/mailcode
Files in mistralys/mailcode
Vendor mistralys
Package mailcode
Short Description Mailcode syntax parsing library for PHP
License MIT
Package mailcode
Short Description Mailcode syntax parsing library for PHP
License MIT
Please rate this library. Is it a good library?
Informations about the package mailcode
Mailcode
A backend-agnostic preprocessor command language for email templates.
What Is Mailcode?
Email template systems often lock you into a specific backend preprocessor — Velocity, HubL, or whatever your mailing platform speaks. Mailcode frees you from that. Authors write in one readable, verbose syntax, and the library translates it into whatever the backend requires. Your email editor becomes portable across platforms without rewriting a single template.
Features
- One syntax, multiple backends — Write once, translate to Apache Velocity or Hubspot HubL automatically.
- Self-documenting templates — Commands read like sentences (
{if variable: $STATUS == "premium"}), making reviews easy for non-developers. - Rich command set — Variables, conditionals (16 subtypes), loops, date/number/price formatting, phone formatting, URL encoding, snippets, and more.
- Safeguard system — Protect Mailcode commands while you process surrounding HTML/text freely, then restore them intact.
- Programmatic command creation — Build commands in PHP via a fluent factory API, not just by parsing strings.
- Syntax highlighting — Render commands with CSS-styled HTML for visual editors.
- Validation built in — Parse results include detailed error reporting; no silent failures.
Requirements
- PHP >= 8.4
- Composer
ext-json
Quick Start
Syntax at a Glance
Supported Commands
| Category | Commands |
|---|---|
| Display | {showvar}, {showdate}, {shownumber}, {showprice}, {showsnippet}, {showencoded}, {showphone}, {showurl} |
| Variables | {setvar} (string, arithmetic, list counting) |
| Conditionals | {if}, {elseif}, {else}, {end} — 16 subtypes (variable, contains, empty, list-contains, begins-with, bigger-than, etc.) |
| Loops | {for}, {break} |
| Formatting | {mono}, {code} |
| Meta | {comment} |
Translation Targets
| Syntax | Coverage |
|---|---|
| Apache Velocity | Full — all commands translated |
| Hubspot HubL | Partial — {break} and {showsnippet} not supported |
Learn More
| Resource | Description |
|---|---|
| Usage Guide | Full syntax reference, all commands, encoding, safeguarding, and translation examples |
| Apache Velocity Translation | Velocity-specific translation details and configuration |
| HubL Translation | Hubspot HubL translation support and limitations |
| Changelog | Version history and breaking changes |
License
Mistralys
All versions of mailcode with dependencies
PHP Build Version
Package Version
Requires
mistralys/application-utils Version
>=3.2.0
mistralys/application-localization Version >=2.1.2
giggsey/libphonenumber-for-php Version ^8.12
monolog/monolog Version >=2.7
ext-json Version *
php Version >=8.4
mistralys/application-localization Version >=2.1.2
giggsey/libphonenumber-for-php Version ^8.12
monolog/monolog Version >=2.7
ext-json Version *
php Version >=8.4
The package mistralys/mailcode contains the following files
Loading the files please wait ...