Tell us what you are trying to do?
Hi there,
I'm trying to set up notifications to fields that are included in my form. For example, when submitting the form, I am fetching the Id of the author of the post against which - the offer in this case - is made. I would then like to send the author an email notifying them of this action. I've tried adding a variety of fields to my forms but for some reasons these do not appear as options in the select options below option 3 (Send notification to an email specified in an email field included in the form) or option 4 (Send notification to a WordPress user with an ID coming from a generic field in the form:).
What am I missing?
Is there any documentation that you are following?
I have consulted the available documentation without any luck.
Is there a similar example that we can see?
I can arrange access if necessary.
What is the link to your site?
hidden link
Hello,
How do you setup the field "Id of the author"?
It needs to be setup as a generic field, and use parameter "generic_type":"user_id", for example:
[cred_generic_field type='select' field='user-id']
{
"required":0,
"default":"0",
"options":[{"value":"1","label":"admin"},{"value":"0","label":"guest"}],
"generic_type":"user_id",
"persist":1
}
[/cred_generic_field]
See my screenshot: user-id1.JPG
Thank you Luo.
I'm not in need of a select field with values. The author is one individual identified by a user id through a shortcode that I've added. I'm not looking to generate a select list of options in the form.
I simply need to be able to capture the user id from the shortcode into a generic cred field to enable the notification to be send the post author where the form is submitted from (not the custom post author submitting the form).
Maybe this option could work - "Send notification to an email specified in an email field included in the form:" but the same options as listed in your screenshot is not available on the generic email field ie. 'This field value is a [a]vailable in notification settings ?
As a workaround, you can setup the generic select field with only one option, the option value is current post author's ID, for example:
[cred_generic_field type='select' field='user-id']
{
"required":0,
"default":["[wpv-post-author meta='ID' item='$current_page' format='meta']"],
"options":[{"value":"[wpv-post-author meta='ID' item='$current_page' format='meta']","label":"[wpv-post-author meta='user_email' item='$current_page' format='nickname']"}],
"generic_type":"user_id",
"persist":1
}
[/cred_generic_field]
More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-author
Thank you Luo.
I've just discovered another way - using the hidden field type generic field combined with my shortcode.
I will also test your solution, thank you.
OK, please update here if you still need assistance for it, thanks
My issue is resolved now. Thank you!