Skip to main content
How to Use the Contact Form Module's Message Pattern

Learn how to create a clear and organized email structure and ensure that the information you collect is presented precisely as needed.

Updated over a week ago

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? 

  1. Include the name and email in the received email's message body

  2. To ensure that all the information that a visitor fills in the Contact Form module is available in the received email's body

  3. To include a text representing the Page's title from where the Contact Form module was submitted.

How to use it?

  1. 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

    Contact Form module - Example of a Field ID

  2. 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

Email

email

Email

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:

Contact Form module - Example of Email containing Message Pattern

Important Notes:

  1. The Message Pattern field doesn't accept HTML code

  2. The Field's ID must start with a letter or the underscore character

  3. The Field's ID cannot start with a number

  4. The Field's ID can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ );

  5. 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.

Did this answer your question?