I added the parent author's email as a generic field, but it's still not visible in the settings (Where to send this notification / Send notification to an email specified in a form field).
Hello. Thank you for contacting the Toolset support.
Well - you used the `hidden field that's the reason you are not able to see the field in the settings. You need to go with one of the solution as given under:
Solution 1:
-- Setup your field as 'email' and chceck if its available in settings and this works but the field will be dispalyed with your form.
Solution 2:
-- If you do not want to display the parent email field with your form and you want to go with the hidden field then you need to use hook: cred_notification_recipients
add_filter('cred_notification_recipients', 'my_cred_notification_recipients_func', 10, 4);
function my_cred_notification_recipients_func($recipients){
if (!is_array($recipients)) {
$recipients=array();
}
if (isset($_POST['_cred_cred_prefix_form_id']) && 9999 == $_POST['_cred_cred_prefix_form_id']){
if(isset($_POST['_parent_email']) and $_POST['_parent_email']!=""){
$recipients[] = array('to'=>'to', 'name'=>'', 'lastname'=>'', 'address'=>$_POST['_parent_email'] );
}
}
return $recipients;
}
Where:
-- Replace '9999 ' with your CRED form ID.
I hope above solution will allow you to resolve your issue.
The notification is set to go to that email (see screenshot).
But in reality it does the opposite - the email goes to the sender himself.
I.e. if I'm logged-in and submit this form, I receive the notification myself, not the email specified in the _parent_name.
I'm sorry for not replying, I'm giving all my time to another project at the moment. If you still need me to give you the access, I can do it over the weekend (please enable private response in that case). Otherwise it's solved for me at the moment.
Thanks.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.