I am creating a search and listing website in wordpress. Have created some custom post type ex. ‘Insurance’ in wordpress with additional fields like ‘name’, ’email’, ‘dob’, ‘premium-amount’,etc. Also, created contact form 7 having fields similar to what on that post type. This contact form okay displaying and working in frontend using its custom shortcode on a page.
I need some way, so that a user/customer on my site fill his name, email, phone etc. along with search terms (‘dob’, ‘premium-amount’) in the contact form. These data should be mailed to admin email (as per contact7 form configuration in admin)and simultaneously the data filled should also be used to search results from ‘Insurance’ type and extra fields, make submit it go the search results page.
The other way I can go through is, make a custom search form in frontend for it and on submitting go to search results page. But then it should be internally use the search fields data to post simultaneously to the contact form 7 so that the search field valus filled by customer can also be mailed to admin mail internally.
I know how to create custom search form and also the contact form 7 override functions like wpcf7_before_send_mail, wpcf7_mail_sent, etc. but not getting the way to make a common form in frontend with multiple input fields to search the post type to display search results, and also mailing the input details to contact form 7 config mail. I dont need success or failure message of send mail to user. User just see the results page, but the query terms he searched for should be mailed internally.
Please help me with that. And guide me which way should i think about: 1) putting contact form 7 form in frontend and using that to search results or, 2) putting custom search form in frontend and using that to mail using contact 7.
(One common integrated form in frontend for both purpose.)
- The topic ‘Integrating contact form 7 with custom search form for custom post type & fields’ is closed to new replies.