The Message Pattern option in Divi's Contact Form module allows you to customize the format of emails received from your website's contact forms. By defining a specific pattern, you can control which form fields are included and how the information is presented, ensuring clarity and relevance in your communications.
Where to Find the Field Content Options
Open the Contact Form Module Settings: Click the gear icon or the module itself to access the settings.
Navigate to the Content Tab: Expend the Email option group.
How to use the Message Pattern
The Message Pattern utilizes field IDs to include specific form data in the email. To incorporate a field's value:
Identify the Field ID of each form field. You can find this by editing the individual field settings within the Contact Form module.
In the Message Pattern field, insert the Field ID wrapped in double percent symbols. For example, to include a field with the ID "name," use
%%name%%
.
You can combine multiple fields and add custom text to structure the email content. For instance:
Name: %%name%%
Email: %%email%%
Message: %%message%%
This pattern will format the email to display the sender's name, email, and message in a clear layout.
Best Practices for Creating Custom Message Patterns
Use Descriptive Field IDs: Assign clear and concise Field IDs without special characters or spaces to ensure accurate data retrieval.
Maintain Readability: Incorporate labels and spacing in your pattern to enhance the email's readability. For example:
You have received a new message from %%name%% (%%email%%): %%message%%
Test Your Pattern: After setting up, submit a test form to verify that the email content aligns with your expectations.
Things to Avoid
Incorrect Field IDs: Ensure that Field IDs in your pattern match exactly, including case sensitivity, to prevent missing data.
Do not use special characters such as special characters like
±, !, @, #, $, %, ^, &
in your field's ID.Overcomplicating the Pattern: Keep the pattern straightforward to avoid confusion and potential errors in the email content.