I will have a number of forms that will each have dropdown menus to choose who the forms gets mailed to. One of the form is working properly now using custom_hooks.php and editing helper-functions.php. Before I configure the next form with the dropdown, I wanted to find out whether I should add the additional code to the custom_hooks.php, or create a new custom_hooks2.php page for each form? The following is what I'm thinking it should look like if I add the code to custom_hooks.php.
<?php
function form4_hook_email($params){
//change the email addresses below
$email_list[1] = 'xxx1@domain.com';
$email_list[2] = 'xxx2@domain.com';
$email_list[3] = 'xxx3@domain.com';
$email_list[4] = 'xxx4@domain.com';
$res = do_query("select element_5 from ap_form_{$params['form_id']}
where id='{$params['entry_id']}'");
$row = do_fetch_result($res);
$attn = $row['element_5'];
$target_email = $email_list[$attn];
if(!empty($target_email)){
return $target_email;
}else {
return true;
}
}
function form14_hook_email($params){
//change the email addresses below
$email_list[1] = 'xxx5@domain.com';
$email_list[2] = 'xxx6@domain.com';
$email_list[3] = 'xxx7@domain.com';
$email_list[4] = 'xxx8@domain.com';
$res = do_query("select element_3 from ap_form_{$params['form_id']}
where id='{$params['entry_id']}'");
$row = do_fetch_result($res);
$attn = $row['element_3'];
$target_email = $email_list[$attn];
if(!empty($target_email)){
return $target_email;
}else {
return true;
}
}
?>
Thank you.
Susan
