...
Filters are applied to individual variables and are preceded by a pipe symbol (|). These will likely not be used. See /vendors/h2o/h2o/filters.php for a complete Parameters are passed to filters using a comma (,) separated list.
Code Block |
---|
{past_due | default 'Not past due'} // Produces "Not past due" if past_due is false |
...
Code Block |
---|
{past_due | default 'not past due' | capitalize} // Produces NOT PAST DUE if past_due is false |
Supported Filters
md5sha1numberfromatwordwraptrimupperlower
Filter | Description | Example Usage |
---|
currency_format | Formats the value into a currency string. Parameters- currency code
| Code Block |
---|
{"1.2345" | currency_format "USD"} |
|
md5 | Hashes the value using MD5. | Code Block |
---|
{"some string" | md5} |
|
sha1 | Hahses the value using SHA1. | Code Block |
---|
{"some string" | sha1} |
|
numberfromat | Formats the value into a number. Parameters- number of decimal places
- decimal point character
- thousands separator character
| Code Block |
---|
{"12345.6789" | numberformat 2, ".", ","} |
|
wordwrap | Wraps a string into multiple lines. Parameters- number of characters per line
- break string
| Code Block |
---|
{"some string" | wordwrap 5, "\n<br />"} |
|
trim | | |
upper | | |
lower | | |
first | | |
last | | |
join | | |
length | | |
urlencode | | |
hyphenize | | |
urlize | | |
set_default | | |
humanize | | |
capitalize | | |
capfirst | | |
tighten_space | | |
escape | | |
escapejson | | |
force_escape | | |
truncate | | |
limitwords | | |
filesize | | |
image_tag | | |
css_tag | | |
script_tag | | |
links_to | | |
links_with | | |
strip_tags | | |
linebreaks | | |
nl2br | | |
nl2pbr | | |
htmlAttribute | | |
extract | | |
date | | |
relative_time | | |
relative_date | | |
relative_datetime | | |
Debugging
Adding the following tag to any email template will enable debugging, and display data key value pairs:
...