This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 ) ) { |