Home › Toolset Professional Support › [Resolved] Set up a contact email for frontend form
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 13 replies, has 2 voices.
Last updated by simchaH 2 years, 10 months ago.
Assisted by: Shane.
Hi,
Is there a way to add a standard email field to either an edit-post-form or an add-post-form that has nothing to do with the actual post, but rather it is specifically just to be able to get a hold of the user if necessary? Meaning, I want the user to put in their personal email not related to the post. Right now I have it set that all users (guests) can add/edit posts, regardless of whether they are signed in or not. I want to be able to add a field to reach out to them in case I need to inquire why they submitted the changes/additions to the post in question.
Thanks,
Sim
Hi Sim,
Thank you for getting in touch.
Is there a way to add a standard email field to either an edit-post-form or an add-post-form that has nothing to do with the actual post, but rather it is specifically just to be able to get a hold of the user if necessary?
I gather here that you don't want to have an email custom field on the post itself but have an email field on the form that the user can enter their personal email correct ? Will this email field be used as a notification on the form ?
I'm not 100% sure of the requirements, can you provide a bit more clarity for me.
Thanks,
Shane
Hi Shane,
Right so the email field should not be "attached" to the form in the sense that it is not updating an actual field in the post. Rather the email field is merely a source of contact method for the guest who is entering information.
Just to explain once more from a different view: A random guest visitor (not logged in) comes to the site. They see a post that seems incorrect, so they click on the edit link which brings them to an edit-post-form. Since this person is a guest and is not logged in, I have no way of reaching out to them. I would like to add an email field or phone number field that each guest will have to fill out (in addition to the edit-form, but separate of the form itself) so that in case I want to reach out to this person to find out why they wanted to edit the post as they did, I can do so.
I hope this helps clarify!
Hi Sim,
Thank you for the clarity.
In this case the best action would be to create a separate post type such as Edit Request which will have the Guests information.
For e.g they go to the post and see that there is a need for an edit. They can click Submit Edit Request which will take them to the form for them to submit a request to edit.
On this form they will submit what is to be edited as well as their phone number and email. This will then be connected to the Post to be Edited via a Post Relationship where the relationship field would've been automatically populated.
From there you can check the edit request, see which post they sent the request for as well as to see the additional information the user provided in the form.
I believe the method above would be the best course of action as if you were to allow the users to edit the Posts directly there would be nowhere to store their emails except on the post itself.
Thanks,
Shane
Thanks for the info Shane,
Okay so just to be sure I understand: I should create a brand new edit-form with all of the form fields of the current edit-post-form. (in other words, duplicate the form). Then, add 2 new fields one for email and one for phone number. Then once that's complete create a relationship between that form and the original edit-post-form I created, so that each field that is related in the post will get auto-filled, but the two newly created fields will stay out?
Sorry about reiterating, I just haven't created a relationship form yet, so I wanted to make sure I understand.
Thanks so much
Hi Simcha,
Not exactly.
What you will be creating is :
1. A brand new post type called Edit Requests. This post type will contain information for the guests so they can be contacted for the purpose of the edit.
2. The Edit Requests post type will be connect via a One to Many relationship with the post type they are submitting the requests for.
3. On the template that is displaying the post you will have a button that says "Submit Edit Request" or some text that says "Found an issue with our Article? Click the button below to submit an edit request"/
4. Once this button is clicked the user will then be taken to the page that has the form for the Edit Request Post Type which would already have the relationship information for which post they're submitting the request for. They will only need to fill in their information such as email and number etc.
Essentially the guest won't be editing the article directly but submitting an edit request so that an admin can see and then make those changes to the article.
Please let me know if this is clearer.
Thanks,
Shane
I think I understand now. My main question is on this statement:
"Essentially the guest won't be editing the article directly but submitting an edit request so that an admin can see and then make those changes to the article."
Does this mean that it won't be "automatic" the way I have it set up now? Right now, a user can submit an edit request which goes straight into the post and the post gets set as "Pending Review". All I need to do is look it over and click "Publish". From your statement above it seems like now I will need to go into the actual post and enter the changes myself. Do I have this correct?
If that is true, is there any way to actually "connect" the Edit Request post together with the actual post so that I don't need to do more data entry and it will stay automated for me?
Thanks
Hi Simcha,
If you have it setup like this now then essentially yes once you hit publish then the article will be updated.
If that is true, is there any way to actually "connect" the Edit Request post together with the actual post so that I don't need to do more data entry and it will stay automated for me?
No there isn't but then I thought of another way you can do this.
Given that you're allowing the users to edit the actual post then you can make use of the Generic Fields option. This will allow you to add a generic email custom field and number field to the form.
These fields will essentially be stored on the post that is being edited but the only way you can avoid this is by using another post.
Another option is to create the custom email field in Types and name it as Last Edited By. This way when the user submits the edits you can essentially see the email of the person who last edited the post and this can be used to contact them.
Thanks,
Shane
Thanks for the info Shane,
So I tried out the first option and input a few generic fields directly into the post form, but when I just tested it and filled out the form, I don't see it in the post in the admin area backend. Do I need to do option two and add Types fields for them, and only then will it display? Or am I searching for those generic fields in the wrong location.
Thanks!
Hi Sim,
Do I need to do option two and add Types fields for them, and only then will it display? Or am I searching for those generic fields in the wrong location.
If you dont have custom fields enabled on the post edit screen then they won't show up.
To enable the custom fields in the gutenburg editor please take a look at the link below.
hidden link
Once you've enabled the custom fields please let me know if you're able to see the email.
Thanks,
Shane
I went through the steps in the link you forwarded, but couldn't seem to find an option for custom fields. Would you like access to see if you can find it yourself? Otherwise I guess I can just do route #2 and add the fields via types to the posts
Hi Simcha,
Would you like access to see if you can find it yourself?
Yes please provide the access as well as a link to the form on the frontend so that I can see how everything is setup.
Otherwise I guess I can just do route #2 and add the fields via types to the posts
You're referring to just set up actual custom field on the article post type that the guest would edit correct.
Thanks,
Shane
Hi Simcha,
Given that these are generic fields then the post would've needed to be created with those fields from the from.
Any post that was created before those fields were added to the form won't have the custom meta added to them.
However I found why you weren't getting the custom field options. It was because the custom fields weren't enabled on your custom post type. I went ahead and enabled this for you by editing the custom post type options.
If you create a new post from your form, you should see these fields appearing.
Given that the fields are now being stored wouldn't it be better to create these fields as types custom fields since this will ensure that there are no issues in retrieving/storing the data ?
Please let me know if this helps.
Thanks,
Shane
I'm going to go ahead and create them as types custom fields as mentioned. My issue is resolved now. Thank you!