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.

Parameters

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

rigFormMailReplace()

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

Company

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