Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save divienginesupport/c956fdd689aadc1601afee8fc4437bc2 to your computer and use it in GitHub Desktop.
Save divienginesupport/c956fdd689aadc1601afee8fc4437bc2 to your computer and use it in GitHub Desktop.
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]';
}
}
return $mail_to;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment