Emailing Form Contents:
| $PHORM_TMPL | The name of a text template file containing the message to be emailed to user. If not specified, contents are not mailed. |
| $PHORM_TO | Email address to send the contents to. It is required if $PHORM_TMPL is specified. If it is not set and $PHORM_ALERTTO is, $PHORM_TO will be set to the value of $PHORM_ALERTTO |
| $PHORM_FROM | Email address for the FROM field of the emailed contents, usually the email address of the visitor. If it is not set, Phorm will check for a form field name Email, EMail or email, and use that if it exists; otherwise $PHORM_FROM will be set to the value of $PHORM_TO |
| $PHORM_SUBJECT | Subject field for emailed contents. |
| $PHORM_HEADERS | Any additional email headers desired, such as X- headers. If you don't know what this means, then it is very unlikely you'll need to use it. |
| $PHORM_EFROM | An alternate FROM address for the email. If it is set, it overrides $PHORM_FROM. Generally it would be used when you have more than one email template, to assign different FROM addresses to the different templates. |
Form contents:
Name: {{name}}
Email: {{PHORM_FROM}}
Comments: {{comments}}
\n). The X-Mailer header is reserved for Phorm.
$PHORM_TMPL[1] = "email.txt"; $PHORM_TO[1] = "manager@mydomain.com"; $PHORM_TMPL[2] = "email2.txt"; $PHORM_TO[2] = "sysadmin@mydomain.com"; $PHORM_SUBJECT[2] = "Email #2"; $PHORM_EFROM[2] = "me@mydomain.com";The maximum number of templates is 25. If you wish, you can include email headers in the template itself. For example:
To: orders@mydomain.com
From: Phorm v3.0 <phorm@mydomain.com>
Subject: Order In
Please send one {{color}} widget to {{name}}.
Any such headers will be overriden by their respective $PHORM_
variables. There must not be any blank lines at the beginning of the file or in the
headers section, and there must be a blank line between the headers and the body of
the message. If you choose to do the headers this way, you must indicate it by adding
+h after the file name in $PHORM_TMPL:
$PHORM_TMPL[1] = "email.txt +h";Note: The intent of this email function is to send information to you, the user. The reason I added the ability to have secondary templates was to allow you to send information to, say, different departments in your organization. While it is possible to send an email to the visitor using a secondary email template, it is my experience that you can end up confusing yourself if you do it this way. To send an acknowledgement to the visitor, use the autoresponder function.