Chapter 13. Email and PDF template

Table of Contents

Base template
Email template
PDF template

Under System - Configuration is Manage templates. A template can be for email, pdf files or both. Email and PDF templates are used automatically in some cases and it's possible to enter expression rules that let's the system pick the right one. They can also be used manually to send emails and pick a template text dynamically or to generate a PDF file dynamically that can be downloaded directly.

Base template

The base of a template has a name, a required key field, a base table and a query used to collect the data used for the template text.

The required key field is used by Two-Spot to know when the template can be used, if the field is available on a record the template is viable. The query is run to collect a single row to apply to the template text. It can always rely on the required key field to be available for substitution. LInked to the base template data is a list of expressions, this can be used to simplify template writing and used to replace complex expressions that collect data under a simpler name. This is especially useful if templates should be edited by translators.

In addition there's a list of default TO addresses for the emails, a list of email templates and a list of pdf templates. The email and pdf templates contain the actual text with template replacement. It's possible to have several of each with different languages, so it's intended for translations. However, it's possible to have several variations for other purposes than translations if needed.