Passer la navigation

[Résolu] I need the contact form to automaticaly select the e-mail address of the author

This support ticket is created Il y a 1 year, 3 months. 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 0 reply, a 1 voix.

Dernière mise à jour par peterV-17 Il y a 1 year, 2 months.

Assisté par: Minesh.

Auteur
Publications
#2799461

I need the contact form to automaticaly select the e-mail address of the author of the page

Hi, you previously helped me with kunstwerken.art with the same question. I tried to replicate, but it doesn't work.

Here's what i need help with:

Bands can create one band bio page on bruiloftbandjes.nl
Visitors must be able to contact them with the contact form.

I've set this up exactly the same as on kunstwerken.art, but it doesn't work. I also want to hide the last row of the contact form. Can you perhaps login to my site and have a look to what i'm doing wrong? Thanks!

#2799466

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and admin access detals and tell me what exactly you would like to achive?

Do you want to send email to post author?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2799530

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

As I understand - you have this post where you have contact form:
- lien caché

And the author of the above post is the following user:
- lien caché

What you want is when user submit the contact form it should send email to above post author user's email that is "Info@changedbyme.nl" and also send email to contact@changedbyme.nl and also to the user's email he will entrer with the contact form field "Your Email Address (please watch out for typos!)" - is that correct? If yes:
- Do you want to display the "selects recipient's email address for message" email field as actually its not required and we can manage using code snippet. So you can remove the field from the form.

#2799638

Oh, i see all these e-mail addresses are viewable for everyone.. can you hide these? Or make this complete ticket private please 🙂

#2799688

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

I do not see contact form on the page you shaerd:
- lien caché

Can you please tell me where I can see the contact form where you added?

#2799694

lien caché

#2799828

i'm sorry, i mis-configured the access control, now it's available at: lien caché

#2799831

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

What I'm saying is - you want to keep those fields on your contact form?

like:
- selecteert e-mail adres van geadresseerde voor bericht
- Artist ID

What fields you want to keep with your contact form?

#2799907

No, if not necessary I don't need them.
The whole bottom row can be deleted, the rest can stay

#2800100

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please check now: lien caché

With your form:
- lien caché

I've added the following code to your form to add the post author ID as hidden field:

 [cred_generic_field type='hidden' field='post-author-id-for-email']
{
"default":"[wpv-post-author format="meta" meta="ID"]",
"generic_type":"user_id",
"persist":1
}
[/cred_generic_field]

More info:
- https://toolset.com/course-lesson/adding-generic-fields-to-forms/

Then I've used the above field with the email notification you added and use the option "Send notification to a WordPress user with an ID coming from a generic field in the form:" and then selected the option name "post-author-id-for-email" that is our generic field added that holds the post author ID.

I've also changed the mail body code as given under:

Bericht verstuurd via bruiloftbandjes.nl:


Onderwerp: %%POST_TITLE%%
Afzender: [types field='naam' item="%%POST_ID%%"][/types]
E-mail Adres: [types field='e-mail-adres-verzender' item="%%POST_ID%%"][/types]
Telefoonnummer indien ingevuld: [types field='telefoonnummer-verzender' item="%%POST_ID%%"][/types]

Bericht:
[types field='bericht' output='raw' item="%%POST_ID%%"][/types]

Can you please confirm it works as expected now.

More info:
- https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/#displaying-post-information-in-notifications

#2800147
Schermafbeelding 2025-03-10 143205.png

Yes it works now, thank you.
But i'm confused, there is a simple checkbox named: Send notification to the post author

Why did we make this so complex? (I copied this way from kunstwerken.aret)

#2800158

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

You said - using that checkbox was not wroking. So I chose the different way.

Does that option works for you?

#2800162

Yes it works now, thanks for the support Minesh
(I ment another checkbox, sorry!)