Contact Form Processing Products - for all your needs

FormMail • Form Encryption • Hosted Forms

Substitution Features in Templates

You can use templates with FormMail for providing "thank you" pages, autoresponse emails, and for the results emails you receive.

A template is simply a document (a plain text or HTML document) with a way of putting field values submitted from your form(s) in the document.

For example:

Customer's name is: $Name
Postal address is: $PostalAddr

FormMail looks for the symbol "$" followed by a field name and replaces it with the fields' value.

FormMail also looks for special substitution expressions and replaces those with the value of the expression.

Substitution Expressions

A substitution expression begins with "${" and ends in "}". Between the "{}" you place the field name, then a colon-separated list of options and other specifiers.

For example, the following will display a short one line summary of a postal address field in an HTML table row:

<tr>
    <td>Postal address is:</td>
    <td>${PostalAddr:chars=20:lines=1}</td>
</tr>

Expression Specifiers

Following is the list of specifiers supported by FormMail:

nobr

Normally, FormMail inserts a <br /> tag before each newline in field substitutions. This is mainly applicable to textarea fields. The nobr option disables the insertion of the <br /> tags.

chars=N

N limits the number of characters substituted from the field value.

lines=N

N limits the number of lines substituted from the field value. Usually used with textarea fields.

sep=S

S is the string to use when FormMail separates elements of a list (array) field. This is the same as, and overrides, the template_list_sep feature.

subs

This tells FormMail to perform TEXT_SUBS substitution on the field value. If you don't specify this option for a field, then its value is sanitized, and any HTML code in the value will be visible instead of operating as HTML. This option only has an effect when processing an HTML template.

 
Close