Created
March 24, 2023 11:58
-
-
Save divienginesupport/0a10025e112ae118875a9f4703135f8f to your computer and use it in GitHub Desktop.
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
function custom_contact_recipient( $mail_to, $form_id, $form_data ) { | |
// Enter your form ID here | |
if ( $form_id == 'add_post_form' ) { | |
// These are the field conditions. We enter the field ID here and the expected value | |
// First condition checks if the Department field is equal to Sales and the Products field is equal to Form Builder | |
if ( $form_data['department'] == 'Sales' && $form_data['products'] == 'Form Builder' ) { | |
$mail_to = '[email protected]'; | |
} else if ( $form_data['department'] == 'Sales' && $form_data['products'] == 'Bodycommerce' ) { | |
$mail_to = '[email protected]'; | |
} else if ( $form_data['department'] == 'Support' && $form_data['products'] == 'Form Builder' ) { | |
$mail_to = '[email protected]'; | |
} else if ( $form_data['department'] == 'Support' && $form_data['products'] == 'Bodycommerce' ) { | |
$mail_to = '[email protected]'; | |
} | |
} else if ( $form_id == 'second_form_id' ) { | |
// These are the field conditions. We enter the field ID here and the expected value | |
// First condition checks if the Department field is equal to Sales and the Products field is equal to Form Builder | |
if ( $form_data['day'] == 'Monday') { | |
$mail_to = '[email protected]'; | |
} else if ( $form_data['day'] == 'Tuesday') { | |
$mail_to = '[email protected]'; | |
} | |
return $mail_to; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment