All the ins and outs of the Mailform extension, so you can customize it to your liking.
You can display error codes and/or error messages when a form submission fails. Simply add {errorcode}
to the div to display the error code and/or {errormsg}
to display the message. The list below contains all error codes that are in use.
As these messages are not always user friendly (or too technical), you can overwrite them with your own by simply creating a JavaScript array in the pages containing a form (or put it in Global HTML). If the error code isn't present in the array you defined, the default error message will be displayed instead.
These come in handy if you have more than one form in your website. With mini templates, you can provide additional text for either the normal mail template or the auto response template.
The mini templates are named mtxt
and rtxt
. The "mtxt" variable only ends up in the normal mail, where the "rtxt" only ends up in the response email. If you make use mini templates, you have to reference them in the mail or response templates under Site Settings. Use {mtxt}
in the mail template, {rtxt}
in the response template.
You can also reference other form variables in mini templates. For example, if your "mtxt" is this: "Hi {name}, thanks for your message. We'll be in touch", the {name}
will be replaced with the name that's submitted with the form.
It's quite easy to use our extension with any of your forms. Just follow the steps below and you're good to go.
The HTML code below is a simplified example of what you need to get the Mailform working, in case you want to create your own from scratch.
NAME | DEFINITION |
---|---|
autorespond | Determines if an auto response email should be sent. Value should be set to "1". |
email | The email address of the person submitting the form. This field must always be present. |
mtxt | Mini template for the normal email. Can contain references to other form variables, like {name} . |
name | Default name of the "name" field that can be used as the name of the sender. This can be changed under Site Settings. |
recipient | Recipient ID that corresponds with a an ID from the Address Book (under Site Settings). |
redirectURL | URL to which the visitor will be redirected after a successful form submission. |
rtxt | Mini template for the response email. Can contain references to other form variables, like {name} . |
subject | The subject of the email. This will also be used for the auto response email, unless overridden in the Site Settings. |
Get in touch