I use in a Post Form a user-select option to redirect the form to another user:
[cred_generic_field type='select' field='user-select']
{
"required":1,
"options":[ [wpv-view name="user-list"] ],
"generic_type":"user_id",
"persist":1
}
How can I add in the email notification as a text field the selected user.
I can do this in the header, so the user will get an email notification but I want to enclude it also as a text field, or a header (to)
For example; Dear [selected user in the form]
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Simon,
For the notification what you can try doing is this.
Add this to your notifications.
[wpv-post-field name='user-select' id='%%POST_ID%%']
Please try this and let me know if it helps.
Thanks,
Shane
I would like to see the user first name, last name and a custom field department (I have it made). If I use POST-ID as you mentioned, I only get the ID as a number.
Do I need to change the view 'user-list'?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Simon,
Could you send me the contents of your view ?
It seems that the view is only getting ID of the user.
Thanks,
Shane
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=1]{"value":"[wpv-user field="ID"]","label":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] [types usermeta='afdeling' separator=', '][/types]"}
[wpv-item index=other],{"value":"[wpv-user field="ID"]","label":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] [types usermeta='afdeling' separator=', '][/types]"}
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Simon,
I see the issue, we are passing the ID as the value of the field.
Try using it like this.
[wpv-item index=1]{"value":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] ","label":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] [types usermeta='afdeling' separator=', '][/types]"}
[wpv-item index=other],{"value":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] ","label":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] [types usermeta='afdeling' separator=', '][/types]"}
This should now give your desired results.
Please let me know.
Thanks,
Shane
How do I change it in the form? Because it's not working and the reciever doesn't get the email.
[cred_generic_field type='select' field='user-select']
{
"required":1,
"options":[ [wpv-view name="user-list"] ],
"generic_type":"user_id",
"persist":1
}
[/cred_generic_field]
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Simon,
Is this the same view that Diego had assisted you with previously ?
If so I would restore it back to its original functionality. Sorry for not realising this earlier.
Restore it to its original state before I started assisting by just re-adding this.
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=1]{"value":"[wpv-user field="ID"]","label":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] [types usermeta='afdeling' separator=', '][/types]"}
[wpv-item index=other],{"value":"[wpv-user field="ID"]","label":"[wpv-user field="user_firstname"] [wpv-user field="user_lastname"] [types usermeta='afdeling' separator=', '][/types]"}
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
This view is meant to pass data for another field.
I believe it would be best for me to have a look at the site so that I can fully understand everything this way we don't lose previously implemented functionalities.
Thanks,
Shane
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Simon,
I see now what you're trying to achieve.
Could you use this shortcode.
[wpv-user field="user_firstname" id="[wpv-post-field name='user-select' id='%%POST-ID%%']"]
[wpv-user field="user_lastname" id="[wpv-post-field name='user-select' id='%%POST-ID%%']"]
This should work given that your form is storing the ID of the selecting user in the user-select field.
Thanks,
Shane
My issue is resolved now. Thank you!