Technical information

INSTALLATION AND ADMINISTRATION GUIDE
154
See Customizing notification email messages
for additional information about customizing notification email
messages.
File structure and syntax
Template files can be plain ASCII text, PostScript, or PCL files. They typically contain a mixture of plain text and tags.
When the fax server processes a template file, it populates any tags it finds in the template file with either the current
value for the tag or default value defined in the template file.
The default value is used only if a current value for that tag is not defined via some other method (e.g., specified on
the command line, in a tag file, or by embedded tag).
It is this conditional behavior (i.e., use the current value or use the default value) that makes template files especially
flexible. Once they are created, they can be shared and re-used throughout your site.
The syntax for defining a tag inside a template file is:
${<tag>[,[<max>].[<length>]][:<default>]}
Where:
<tag>
Tag name.
,[<max>].[<length>]
Optional length statement. Tag values exceeding <max> are truncated to that value by
removing characters from the left of the value; tag values shorter than <length> are
made that length by appending trailing spaces to the right of the value
<default>
Optional default value for the tag.
Consider the following example send-notify template:
Your fax request ${seq} to ${tnm:<unknown>} at ${tfn}
was sent at ${sti} with a result of ${rrs}.
Fax info:
# pages : ${npg}
memo : ${ntf}
The first line contains a synopsis of the fax request status, comprising the fax request ID (seq) tag, the recipient
name (tnm) tag, recipient fax number (tfn) tag, send time (sti) tag, and the fax request result code description
(rrs) tag. If the tnm tag has a current value, that value is used. If tnm has not been defined, the default value,
unknown, is used.
The remainder of the message includes the total number of pages (npg) tag and contents of the note file as defined
by the ntf tag.
Special capabilities and limitations
When working with template files, be aware of the following special capabilities and limitations:
Template files must reside in the $VSIFAX/lib/templates directory. Template files in other directories
cannot be used by the system.
The note file (ntf) tag is special. If specified in a template file, the content of that file is inserted into lines
immediately following the ntf reference.
If a tag is specified without a default value and that tag is empty (i.e., it has no associated value), an empty
string is output.
If the <max> value is greater than the <length> value, it is set to <length>.
If a template file is specified and cannot be found, the default message will be silently used.
The vinfo templates command lists all template files in the $VSIFAX/lib/templates directory.