Skip Navigation

[Resolved] contact form to the author of the content

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a Form that is placed on a custom post. The custom post has a custom field that holds an email address. I would like to use that email address as the destination of a Form notification email.

Solution: You can use a hidden generic field in the Form to capture the email address from the post, which is the same as the current page:

<div style="display:none;">
[cred_generic_field field='gen-field-1' type='email' class='' urlparam='']
{
"required":0,
"validate_format":0,
"persist": 1,
"default":"[wpv-post-field name='email-field' id='$current_page']"
}
[/cred_generic_field]
</div>

Then submit the form at least once. Edit the email notification and you should find the generic field in the options for the email destination field.

Relevant Documentation:
https://toolset.com/documentation/user-guides/inserting-generic-fields-into-forms/
https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/

This support ticket is created 6 years, 5 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#929356

hi,
i mage custom type with field email.
i like to put contact form in each post that will be sent to the email address that entered to that field.

i know cred is not build for contact and and made another custom type called "contact" to save all that contact.

now i have 2 questions:
1. how i make the form send the emil to the email field of the post ?
2. how i attach the new contact post that have been submited to the author of the post so the author of the post will be able to see his history contacts forms ?

tnx
nir

#947819

1. how i make the form send the emil to the email field of the post ?
You can add a generic hidden field to the Form, and set the value of that field using a shortcode like this:

<div style="display:none;">
[cred_generic_field field='gen-field-1' type='email' class='' urlparam='']
{
"required":0,
"validate_format":0,
"persist": 1,
"default":"[wpv-post-field name='email-field' id='$current_page']"
}
[/cred_generic_field]
</div>

Change email-field to match the slug of the email field on the main post. Then submit the form at least once. Now, you should be able to select the generic field gen-field-1 as the notification destination email address in the Form editor screen.

2. how i attach the new contact post that have been submited to the author of the post so the author of the post will be able to see his history contacts forms ?
May I kindly ask you to submit this question in a separate ticket? Our support policy states that we only address one issue per ticket, and this question does not have a simple answer. Please add a new ticket and we can discuss in more detail.