I am creating a bilingual site. I have a form with various fields and one of them is a datepicker (using the template's tools - the datepicker passes thedata in a text field). When the user chooses "English" for a strange reason the date changes format and from dd-mm-yy becomes mm-dd-yy. I was not able to find a solution with the template's tools so I thought that before the form is sent to the owner of the site there would be a mechanism that checks if the language is english and if yes then it parses the field, makes the adjustement and then sends the form. So far I was able to access this data but I am not able to modify it.
I have created a hook (before_send_mail) and in there
$submission = WPCF7_Submission::get_instance(); $data = $submission->get_posted_data();
$data['date'] gives me the access to the field, I can modify it, even save a file with the value but the email that arrives contains the values unaltered. What can I do to alter the value of the field before it is sent?
Please do not tell me to change the field from text to date or to contact the template's creator. The first one is not possible the second is ongoing.