Modify Divi Contact Form Module

If you are using Divi wordpress theme, to build custom layouts for your wordpress posts, pages or projects, and use the Contact form Module to each of the post or project, you will notice that the subject of the email you will receive is not to good.

Let’s just think that you have an affiliate website like this one, when for each theme (project) you want to have this Contact Form module which can be use if someone will ask you for a particular topic. For example, I put on my website some of the themes that Elegant Themes offers, and for each theme at the bottom I have a contact form.

I want the email subject I will receive to be: Customization request for {project_name}.

A more relevant example will be:
Joe Doe, will find this project called Divi WordPress theme and he will fill out the contact form to ask for a customization support.

My email which I will receive from Joe Doe, will have the subject: Customization request for Divi WordPress theme, which is the actual title for this particular project.

To do that, we will need to edit/modify the function.php file.

First of all make sure to backup this file, open it in your favorite text editor and go to line 2115 or search for $et_site_name = get_option( 'blogname' );. You can delete this line or you can leave it. After this line add this line of code:

Next replace this block of code (line 2124):

with this:

Examples

Contact form module - Example Inbox
Example Inbox
Contact form module - Example Email
Example Email

Finally save the file and uploaded to your server.

As a result when someone will use Divi Contact Form Module, the email subject you will receive will be the page title.

Published by Eduard

A young and passionate man which loves to build and to customize WordPress Themes. His main passion is to work / improve / customize Divi WordPress Theme from Elegant Themes.

Join the Conversation

14 Comments

    1. Thanks Eduard – I am new to WordPress – I was expecting to be able to change the message within the Divi module or php file (having said that, I couldn’t find where the message is located) rather than having to add a new module.

      1. Hi, did you follow the instruction I did posted here: https://wp-ninja.net/custom-contact-module-divi-2-5-6/?
        I did created instructions, how to properly change the Thank you message, you just need to edit the string: Thanks for contacting us, in this piece of code: esc_html__( 'Thanks for contacting us', 'et_builder' ). I did choose to use a child theme, so you guys keep this change even if you update you parent theme. If you don’t want to use a child theme, then you can edit the php file called main-modules.php located in divi/includes/builder folder, and just do a search for ‘Thanks for contacting us’ to find the string you need to change.

        Hope this helps.
        Best Regards.

    1. Hi please check with your hosting company, since this could be related to your server configuration. Also you can try to install Contact Form 7 plugin, and see if that one works. Hope it helps.

  1. Hi Eduard, we are using Divi builder and need help customizing the contact form module. We would like the form to simply display the submit button (no spaces for entry of name/email/etc) on project pages so that when a logged in user clicks the submit button, an email is sent to our admin email with the logged in users name, email and tag of project name or url in email message body. Currently, you will be unable to view the actual project page as it is restricted to members. Please email as we would like to speak with you about contracting your services for this work.

Leave a comment

Leave a Reply

Shares
Share This
%d bloggers like this: