I am trying to build a form to send information to another subscribed user (another employee)
The users we keep in this site are all employees (intranet) and I would like to build forms to notify
another user. In the form it must be possible to select the other user.
Finally when the form is sent, I would like to have the possibility to change the status of the result from that form by the original sender, the receiver or a somebody with a specific role.
Will this be possible with Toolset?
So far I have setup the website with registration page and login/my account page with Toolset.
Hello @simonR-7, welcome to the Toolset support Forum!
It's possible to add a field to select the user, then send a email notification to the selected user using the steps below:
- Go to Views > Add new and create a view to list all users in JSON format
--- On the first popup, select "Display all results"
--- On "Content Selection"", select Users > Any role
--- Paste the following code on the Lopp Editor
[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_nicename"]"}
[wpv-item index=other],{"value":"[wpv-user field="ID"]","label":"[wpv-user field="user_nicename"]"}
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
--- Uncheck the "Disable the wrapping DIV around the View" field
- Go to the edit screen of your form, click on "Add generic field" then choose the "Select" field
- Add a field slug, select " Get options from a shortcode" and put the shortcode of the user list view here (e.g. [wpv-view name="NAME_OF_THE_VIEW_HERE"])
- Make sure to check the "This field value is an user ID, and should be included in the list of available recipients for notifications" option and insert the field
- Scroll down to Email Notifications and click on "Add new notification"
- On "Notification e-mail recipients", select " Send notification to a WordPress user with an ID coming from a generic field in the form:" and set the select field that you created (see screenshot)
- Fill the notification options you want, add the message of the email on the "Notification e-mail body" field and save
For more details, please take a look at this documentation link: https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/
Please let me know if it worked for you.
All the best,
Diego
Thank you for the steps, really clear explanation.
The output of the form at the frontend didn't work well, perhaps you'll see what's going wrong:
[cred_generic_field type='select' field='abc_form'] { "required":1, "options":[ {"value":"2","label":"mynamegmail-com"} ,{"value":"1","label":"sitename"} ], "generic_type":"user_id", "persist":1 } [/cred_generic_field]
Hi there,
These are the steps to create the generic field:
- Go to the edit screen of the form
- Click on "Add generic fields"
- Click on "Select"
- Fill the options like in the example (see screenshot ts6.png) and click on insert
- It should appear like the screenshot (ts8) on the back-end, but it shoud display a select field with the options on the front-end
Please check if these steps works for you.
Kind regards,
Diego
Sorry, did the same but still only code for output.
I have exactly reproduced all steps, what could I be missing?
Hi there,
Please send us access to your WordPress dashboard (website URL, login and password) I'll check and do some tests. - Please use the private field to send the sensitive data - do not post if you do not see it.
IMPORTANT Please backup a working copy of site files and database before.
Please also send us the link of the page with the issue.
Kind regards,
Diego
Hi there,
I noticed that you are missing the [credform] and [/credform] on your form cell (and also the submit button which is mandatory for forms).
I have fixed this and now the dropdown is available with the user list: hidden link
Kind regards,
Diego
My issue is resolved now. Thank you!
I would like to continue on this thread, is that possible?
I (You) managed to encluded 'to' another user in the frontend form.
My question now is, how do I add an 'edit' link for each post.