Skip to content

Instantly share code, notes, and snippets.

// This works on an AWS Lightsail instance using WP Mail SMTP and is current as of Feb 2025
// Place this code in your functions.php file in your divi-child theme
// This sends a copy of any message sent via the Divi contact form module to a predetermined email
function send_copy_of_contact_email( $processed_fields_values, $et_contact_error, $form_data ) {
$admin_email = get_option( 'admin_email' ); // Change if needed
$subject = "New message from " . get_bloginfo( 'name' ) . " - Copy";
// Exit if no data or error
if ( empty( $processed_fields_values ) || !empty( $et_contact_error ) ) {