Send form to ACF-field [RESOLVED]

Hi everyone,

I’m using Wordpress, Elementor, Gravity Forms and Advanced Custom Fields (ACF) for a website collecting cycling cafes in NL and BE: www.wielercafes.nl.

On the page of every singular cycling cafe there is a simple contact form. I want this to be send to the emailadres of that particular cycling cafe. This emailadres is given using ACF at the backend. For now the contactforms are made with Elementor itself.

Is it possible to let the form send to the emailadres that is given to the particular cycling cafe?

Hopefully you can help me out.

Regards,
Ruben

We can help if you use Gravity Forms, not Elementor forms. Are you going to switch?

That’s what I meant to say: I used Elementor Forms before.
Now I’m using Gravity Forms.
Some forms still need to be transformed.

Hi Ruben,

If you are using Gravity Forms, you can pull that email address if it’s stored in a custom field on the post you’re displaying the form.

You can use the {custom_field} merge tag to populate a custom field from the post:

As an example, if you’re on the post for the Cycling Cafe and the email address is stored in a custom field called cycle_email, you could call that field with {custom_field:cycle_email} and it will pull that from the post the form is embedded on.

You can use that merge tag to set the default value of the email field on your form and hide it using Visibility: Hidden.

Thanks for your help Jim.

I tried a few things but still did not get this work.

The old form was using [field id=“emailadres_wielercafe”], but this is not working for Gravity Forms.

How do I find the exact name of the custom (ACF-)field (e-mailadres of the cycling cafe) for Gravity Forms?

You can check the wp_postmeta table to see what the meta key name is. Based on the shortcode you shared, it might be emailadres_wielercafe. Try this merge tag (with curly braces):

{custom_field:emailadres_wielercafe}

Where do I find this ‘wp_postmeta table’?

The code

{custom_field:emailadres_wielercafe}

did not work.

The ACF Field configuration should give you the proper field name for wp_postmeta.
When you’re in ACF for the field, it’s the ‘field name’ field that contains that value:

1 Like

Thanks, this did the job.

I looked up the ‘Field Name’ at ACF in the Wordpress Dashboard.
I used {custom_field:FIELDNAME} to send it to the correct mailadres.

Thanks a lot!
Topic can be closed.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.