Is there a way to make it so the form results are emailed to a certain email address based on a selection in the form?
In other words, if a questions says " are you a new applicant or a returning applicant". If they choose "new applicant" it goes to one recipient. But if they choose "returning applicant", it goes to a different recipient.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"In other words, if a questions says " are you a new applicant or a returning applicant". If they choose "new applicant" it goes to one recipient. But if they choose "returning applicant", it goes to a different recipient. "
Modify your processor.php file according to this example:
Code to add:
if($returning_field){
$sendto="emailaddress1";
} else if ($new_field) {
$sendto="emailaddress2";
} else {
$sendto="defaultemailaddress";
}
Code to modify:
mail($sendto,"Form Submitted at your website",$message,"From: phpFormGenerator");
Obviously this is just a rough example. The exact code depends on your form variables.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can not tell your how to modify code I have never seen.
From my previous post:
"Obviously this is just a rough example. The exact code depends on your form variables.
"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way to make it so the form results are emailed to a certain email address based on a selection in the form?
In other words, if a questions says " are you a new applicant or a returning applicant". If they choose "new applicant" it goes to one recipient. But if they choose "returning applicant", it goes to a different recipient.
Thanks!
You need to manually edit your generated code in order accomplish this.
On a side note, this question comes quite often. Perhaps we should add this as a special case feature in future versions.
I figured I would have to modify the code. how would I do that?
I figured I would have to modify the code. how would I do that?
Based on your first post.
"In other words, if a questions says " are you a new applicant or a returning applicant". If they choose "new applicant" it goes to one recipient. But if they choose "returning applicant", it goes to a different recipient. "
Modify your processor.php file according to this example:
Code to add:
if($returning_field){
$sendto="emailaddress1";
} else if ($new_field) {
$sendto="emailaddress2";
} else {
$sendto="defaultemailaddress";
}
Code to modify:
mail($sendto,"Form Submitted at your website",$message,"From: phpFormGenerator");
Obviously this is just a rough example. The exact code depends on your form variables.
I can not tell your how to modify code I have never seen.
From my previous post:
"Obviously this is just a rough example. The exact code depends on your form variables.
"
OK, so you provided the code to modify but didn't say how to modify it. What needs to be added or changed in that line?
Thanks!