All Collections
Divi Documentation
Customizing Divi
Sending a copy to the sender with the Contact Form module.
Sending a copy to the sender with the Contact Form module.
Cristi avatar
Written by Cristi
Updated over a week ago

If you also want to send a copy to the sender of the message with Divi's Contact Form module, then you will need to override the default module. 

A child theme is required for this process so if you don't have one, make sure to check our tutorial on How To Make A Child Theme.

First, create a folder called module in the child theme folder. You can do it via FTP or via a plugin such as File Manager. In that folder, create a file called ContactForm.php and add this code inside: ContactForm.php

After that file is created, add this code in the functions.php file of the child theme:

/*================================================
#Load custom Contact Form Module
================================================*/
function divi_custom_contact_form() {
get_template_part( '/module/ContactForm' );
$dcfm = new Custom_ET_Builder_Module_Contact_Form();
remove_shortcode( 'et_pb_contact_form' );
add_shortcode( 'et_pb_contact_form', array( $dcfm, '_render' ) );
}
add_action( 'et_builder_ready', 'divi_custom_contact_form' );

function divi_custom_contact_form_class( $classlist ) {
// Contact Form Module 'classname' overwrite.
$classlist['et_pb_contact_form'] = array( 'classname' => 'custom_ET_Builder_Module_Contact_Form',);
return $classlist;
}

add_filter( 'et_module_classes', 'divi_custom_contact_form_class' );

Did this answer your question?