Developing on Invoiced
Template Language
8min
the invoiced template language is a powerful, easy way to customize the invoices, statements, emails, text messages, and more on invoiced our template language is built on the popular twig template language with custom extensions designed for the unique requirements of billing usage invoiced template language can be used to generate personalized emails, messages, and documents in this document you will learn about all of the capabilities and features of the template language variables the most common use of the template language is to output variables in order to use a variable, the name is wrapped in {{ and }} invoiced template language {{ customer name }} tags tags allow you to implement logic within your template, like branching and looping here is an example of an if statement invoiced template language {% if invoice status == "past due" %} past due {% endif %} available tags (click to learn more) if https //twig symfony com/doc/2 x/tags/if html for https //twig symfony com/doc/2 x/tags/for html set https //twig symfony com/doc/2 x/tags/set html filters filters allow you to modify variables before they are output into the document here is an example of a filter that formats the invoice variable as a money amount and output in your document invoiced template language {{ invoice balance|money }} available filters (click to learn more) abs https //twig symfony com/doc/2 x/filters/abs html batch https //twig symfony com/doc/2 x/filters/batch html capitalize https //twig symfony com/doc/2 x/filters/capitalize html date https //twig symfony com/doc/2 x/filters/date html date modify https //twig symfony com/doc/2 x/filters/date modify html default https //twig symfony com/doc/2 x/filters/default html escape https //twig symfony com/doc/2 x/filters/escape html first https //twig symfony com/doc/2 x/filters/first html format https //twig symfony com/doc/2 x/filters/format html join https //twig symfony com/doc/2 x/filters/join html last https //twig symfony com/doc/2 x/filters/last html length https //twig symfony com/doc/2 x/filters/length html lower https //twig symfony com/doc/2 x/filters/lower html merge https //twig symfony com/doc/2 x/filters/merge html money formats a number as a money amount money unit cost formats a number as a money amount according to the rules for unit cost nl2br https //twig symfony com/doc/2 x/filters/nl2br html number format https //twig symfony com/doc/2 x/filters/number format html number format no round formats a number without applying any rounding or modification of decimal raw https //twig symfony com/doc/2 x/filters/raw\ html replace https //twig symfony com/doc/2 x/filters/replace html reverse https //twig symfony com/doc/2 x/filters/reverse html round https //twig symfony com/doc/2 x/filters/round html slice https //twig symfony com/doc/2 x/filters/slice html sort https //twig symfony com/doc/2 x/filters/sort html split https //twig symfony com/doc/2 x/filters/split html title https //twig symfony com/doc/2 x/filters/title html trim https //twig symfony com/doc/2 x/filters/trim html upper https //twig symfony com/doc/2 x/filters/upper html functions you can call a functions to generate content functions are called by their name followed by parentheses and optional arguments for example this will show the maximum of the two values invoiced template language {{ max(invoice subtotal, invoice total) }} functions can be combined with filters invoiced template language {{ max(invoice subtotal, invoice total)|money }} available functions (click to learn more) cycle https //twig symfony com/doc/2 x/functions/cycle html date https //twig symfony com/doc/2 x/functions/date html dump https //twig symfony com/doc/2 x/functions/dump html dump scope dumps all of the variables available within the template in a readable format max https //twig symfony com/doc/2 x/functions/max html min https //twig symfony com/doc/2 x/functions/min html random https //twig symfony com/doc/2 x/functions/random html range https //twig symfony com/doc/2 x/functions/range html trans translates a string in the customer's locale transchoice translates a string in the customer's locale with pluralization rules