[ad_1]
I have a scenario where I need to use the same contact form on multiple buttons. but once a contact form is submitted, I need to know which button they submitted the form from.
More detail, I’m listing unique widgets for sale as blog posts. Each widget or blog post I list has a “contact for more info” button which pops up a contact form. When someone submits that contact form, I need to know which widget they requested more info about.
I’m totally new to this, any help is appreciated. Thanks!
[ad_2]
To track the specific widget related to the query, add a hidden field to your form. Insert the following form tag into your form editor, placing it where you want the hidden field to appear (usually before the submit button, towards the end):
[hidden widget-id “default”]
When you add the contact form shortcode to each post, modify it by adding an identifier for each widget. Here’s how to do it:
[contact-form-7 id=”123″ title=”Contact form 1″ widget-id=”Widget1″]
(replace “Widget1” with the appropriate identifier for each widget or post)
Edit Each Post In each blog post, insert the modified shortcode with the unique widget identifier relevant to that post.
When someone submits the form, the identifier (e.g., Widget1) will be included in the email you receive. Make sure to configure your mail template in Contact Form 7 to include the hidden field. You can do this by adding [widget-id] in the Mail section of your form settings where you want this identifier to appear.
Thanks for the response! I followed your steps and I think I’m on the right track, but my emails are coming in with a line that says default Instead of widget1