[Resolved] I would like to add a form on every CPT…
This support ticket is created 3 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Tell us what you are trying to do?
I would like to add a form on every CPT, front-end. The owner of that post type will receive the message to their email.
1. How can I create this form?
2. How do I add it to the post?
3. How do I make sure the owner of the post receives the mail?
You want to use the form for someone to contact the publisher of the post, yes?
With Toolset Forms, the forms always publish (or edit) a post, there are no disposable form submissions, so the first thing you need to do is create a CPT for the form submissions (e.g. "messages").
In your case you need the form to be sent to the author of the post where you are going to display the form, and that needs handling in a particular way.
You need to add a Hidden generic field to your form (drag into the form from the section on the right), choose a slug for the field (e.g. "post-author"), and provide the following default value:
[wpv-post-author format="meta" meta="ID"]
Also, make sure the setting that this field is a user ID is checked (see screenshot).
Then when you add a notification, the email address for the recipient can be chosen under the setting "Send notification to a WordPress user with an ID coming from a generic field in the form".