Form-Mail Helper

The Form-Mail Helper provides functions that assist in working with Form-Mails.

Loading this Helper

This helper is loaded using the following code:

rigLoadHelper "formmail"

The following handlers are available:

rigFormMail(filePath, substitutionData, prefix, suffix)

Fetches the form-mail template, assigns an array containing words for substitution and assigns prefix/suffix characters used in the mail template to surround the words to be substituted.

The first parameter is the path to your mail template relative to root. Remember: Root is where your file is located. The second parameter is an associative array where the keys are the placeholders used in your template and the values are the words used for replacement. The third and fourth parameters are optional. The default values are: "<#" for prefix and ">" for suffix. You have to assign these values if you use different characters for prefix and suffix in your template.

This function returns FALSE if the template was not found or TRUE otherwise.


Substitutes the placeholders in your template with the values of an array.

This function returns the customized text of your form-mail.


Let's say your template looks like this:

Dear <#firstName> <#lastName>,

thanks for your message regarding <#subject>.
We will see to your case quickest possible.

Best regards
Rev Igniter


Then your code would look like this:

put "John" into tFormMailArray["firstName"]
put "Doe" into tFormMailArray["lastName"]
put "revIgniter" into tFormMailArray["subject"]

put "assets/modules/contact/emailText/contactConfirmationMail.txt" into tMailText

get rigFormMail(tMailText, tFormMailArray)
put rigFormMailReplace() into tResponse