Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save divienginesupport/8357fa740e3061a6cc822c5b634eb3e0 to your computer and use it in GitHub Desktop.
Save divienginesupport/8357fa740e3061a6cc822c5b634eb3e0 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
if ( $form_data['department'] == 'Sales' ) {
$mail_to = '[email protected]';
} else if ( $form_data['department'] == 'Support' ) {
$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