Okay, let say we have a form with id = 3 and the dropdown list is having id = 'element_4' (view the html source of your form to see it).
Edit your includes/helper-functions.php file. Around line 470 you'll find this code:
$mail->Send();
$mail->ClearAddresses();
Right below that code, insert this code:
if(function_exists("form{$form_id}_hook_email")){
$carbon_email = call_user_func("form{$form_id}_hook_email",$table_data);
if(!empty($carbon_email)){
$mail->AddAddress($carbon_email);
$mail->Send();
}
}
Next edit your hooks/custom_hooks.php file and insert this code below anywhere:
function formXXX_hook_email($user_input){
//change the email addresses below
$email_list[1] = 'email1@example.com';
$email_list[2] = 'email2@example.com';
$email_list[3] = 'email3@example.com';
$attn = $user_input['element_YYY'];
$target_email = $email_list[$attn];
if(!empty($target_email)){
return $target_email;
}else {
return true;
}
}
Adjust the value in that code to match your own form id and dropdown id.
XXX -> form id
YYY -> dropdown id
That would send email to different address based on the selection of a dropdown list.
MachForm Founder