Output Data using a File Template
A file template can be used while sending email with Telegraph, creating a list that is stored on the server, or when filling out an HTML guestbook page for your website.
- Add this line of code to your Telegraph configuration file:
<directive action="file" filename="filename-relative-to-form" template="template-location-relative-to-form" />Replace filename-relative-to-form with the name of your output file (including any relative path information) and template-location-relative-to-form with the location of your template file (also including any relative path information).
<directive action="file" filename="output/military.txt" template="templates/military.template" />
When creating your template file, use these guidelines:
- Indicate where the template submissions should be added to the output file using [template:begin] and [template:end]. Multiple submissions will be inserted in descending chronicle order.
- Use square-bracket field names to pull field information from your form.
- Example: [serial-number]
A complete example template file might look like this:
[name] has enlisted in the US Armed Services at the rank of [rank]. His/her serial number is: [serial-number].
Output from a form using this template would look like this:
Joe Schmoe has enlisted in the US Armed Services at the rank of Private. His/her serial number is: 123-456-7890.