A template is simply a file. It can be used to format
your emails and responses in any way you choose. Templates are
supplied with the software or you can create your own with
your favorite HTML editor, notepad or even Microsoft Word.
A
template can be an HTML file or a plain text file. Within the
template you have static information that you wish to display
but you can also include dynamic information. Dynamic
information is the information entered on your form
To distinguish dynamic information you include
this in your template file:
[xxxxxxx]
The
brackets say that this is dynamic information.
The xxxxxxx
is the field name from your form.
A sample template is included. The file name is testtemplate.txt
and testrespondertemplate.txt.
TestTemplate.txt
In the example template you will see that
is a combination of plain text and items within brackets
[]. The items with brackets will have their values substituted
when the form data is entered.
Advanced Form Handling Sample Template
Any fields in the form can be used
Firstname: [Firstname]
Lastname: [Lastname]
State: [State]
Address: [Address]
Address2: [Address2]
City: [City]
Postcode: [Postcode]
Country: [Country]
Phone: [Phone]
Email: [Email]
Comment: [comment]
Creating a template -
afhgeneratetemplate.asp
A template can be created using
your favorite text editor. If you have a large form, remember
all the field names may be tedious. To help, a program
called afhgeneratetemplate.asp is provided. To
use it edit your form and replace the action value with the
file name as in the example:
<form name=testform method=Post
action=afhgeneratetemplate.asp>
Now simply press the
submit button on your form and a basic template with you field
names will be created on the browser. Use this as the starting
point in creating a customized email template for the form.
Using
the template
In the form configuration, either as a hidden
field on the the form configuration file set
<input type=hidden
name="config_emailtemplate" value="mynewmailing.txt">
and
<input type=hidden
name="config_emailrespondertemplate" value="sendtoresponder.txt">
Formatting
within Templates
Sometimes fields should be specially
formatted. For example currency or dates. In that case some of
the place holders can have information about their formatting.
There are more formatting described in the User's Guide.
|
[formatcurrency xxx] |
Formats data in currency
format around to sites local system type |
| [formatdate xxx] |
Date formatting |
| [special date] |
Includes date |
| [special time] |
Includes time |