Changing Form Data Before it is Saved with ContactForm7
-
I am using ContactForm7 & Contact Form DB plugin to contacts in database.
In contact form 7 I used “|” (pipe) operator to send mail according to country in select option.
But for to save country name in database, I used filter as;
function location_form_handler_Opportunities_Contact($formData)
{
$formName = ‘Opportunities_Contact’; // change this to your form’s name
$fieldName = ‘your-country’; // change this to your field’s name
$newFieldName = $fieldName . ‘_email’;
return form_with_pipes_handler($formName, $fieldName, $newFieldName, $formData);
}add_filter(‘cfdb_form_data’, ‘location_form_handler_Opportunities_Contact’);
I have some of email id’s for specific countries, and for remaining countries I used one email id as e.g: [email protected]
My problem is save country name(_raw_your-country) as well in database I used above filter & it working perfectly for specific email id, but it is not working for common email id (that is your-country value is not correct, it takes first value in option with name of the county having common email id.) Therefore in database the first country name is saving instead of respective country associated with email id.
Please help to resolve this issue.
https://www.ads-software.com/plugins/contact-form-7-to-database-extension/
- The topic ‘Changing Form Data Before it is Saved with ContactForm7’ is closed to new replies.