What is a message pattern?
It's a way for you to customize the layout of the message you receive from people. By default, it would include all of the form fields (except the name and email), but if for some reason you want to change the layout, you can use this option.
Why use the message pattern?
To include the name and email in the message body, because by default it's not included, however, when you click the reply link you'll see the sender name and email there:
2. To style the message and make it more clear, especially when you have a lot of fields, you'll want to organize the message better.
3. To add a title to the contact form, so you'll know from which page this message came from (if you have multiple contact forms on the site).
And for other reasons maybe.
How to use it?
Very simple, put your text (ex: from John) and replace the name here with a variable of the name field.
Here's a practical example, but first let's take a look at the form:
This is how our message gets to our inbox:
Let's say we want to change that to something like:
From (John Doe), phone number is: (123456789) via ([email protected])
TOS choice: (Yes)
Message: (Hello, this is the message.)
This is how we add the message pattern:
So we basically add the field ID wrapped within %% at the beginning and the end of it. And we get this output:
By using this option, you can customize the message layout in any way you want.
Important. The Field ID and Message Pattern field should follow the following rules:
The message pattern field doesn't accept HTML code;
A Field ID name must start with a letter or the underscore character;
A Field ID name cannot start with a number;
A Field ID name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ );
Field names are case-sensitive (
$AGEare two different variables).