The Contact Form Module in Divi offers a versatile way to collect information from your website visitors.
One of its powerful features is the ability to customize the message pattern, allowing you to format the emails you receive in a way that best suits your needs.
What is a Message Pattern?
The Message Pattern is a way to customize the layout of the messages you receive from people.
By default, it includes all the form fields (except the name and email), but if you want to customize the messages sent by your site visitors and customers, you can use this option.
Why use the Message Pattern?
Include the name and email in the received email's message body
To ensure that all the information that a visitor fills in the Contact Form module is available in the received email's body
To include a text representing the Page's title from where the Contact Form module was submitted.
How to use it?
Identify the field's ID that you want to include in the Message Pattern by clicking on the Gear icon and see the Field ID's value
In the Message Pattern, wrap the field's ID into %%. For example %%Email%%
Use Case
The example Contact Form module has 4 fields:
Field Name | Field ID | Type |
Name | name | Input |
Interests | interests | Radio buttons |
Message | message | Text Area |
In the Contact Form module's Message Pattern, you can use:
Name: %%name%%
Email: %%email%%
Interests: %%interests%%
Message:
%%message%%
When the Contact Form module is submitted, the following email will be received:
Important Notes:
The Message Pattern field doesn't accept HTML code
The Field's ID must start with a letter or the underscore character
The Field's ID cannot start with a number
The Field's ID can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ );
The Field's ID is case-sensitive (
$age
and$AGE
are two different variables).
Pro tip: While the Field's Label text can be anything you want, it is recommended that you use simple and meaningful text for each field's ID, following the rules from above.