Custom function $posted_data not working after 5.2
-
Hi,
I have an issue since 5.2.1 update. 5.2.2 did not resolve my problem.
I have a custom function to change recipient according to customer country or region. I was checking $submission->get_posted_data() to compare with my database to find the right recipient email and change it before sending notification.
Since 5.2.1 update it doesn’t work anymore and I don’t know why because I don’t see anything related inside your changelog.
I had to roll back to 5.2.My function is hooked to wpcf7_before_send_mail and here is a piece of my function so you can see what I’m using inside :
$current_mail_array = $contact_form->prop('mail'); $submission = WPCF7_Submission::get_instance(); $posted_data = $submission->get_posted_data(); if(array_key_exists($posted_data['my_form_field'], $emailpays)) { $current_mail_array['recipient'] = $emailpays[$posted_data['my_form_field']]; } $contact_form->set_properties(array('mail'=>$current_mail_array));
Do you know what my problem is and how can I solve it ?
I would like to keep CF7 up to date.Thanks,
Have a nice day !
- The topic ‘Custom function $posted_data not working after 5.2’ is closed to new replies.