Skip Navigation

[Resolved] Approval workflow for User CRED forms

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

Problem: My site admins want to receive automatic email notifications when someone registers on the site. They would like to be able to approve or decline those registrations before the User can access the site.

Solution: Use a new User CRED form that creates new Users in a custom role like Pending Approval. Add your email notification to this form. Admins will receive a notification when a new User registers, and can then change the User's role to something else like "Member". To send the User an automatic notification when they are approved, you must use an edit User CRED form to change the User's role.

Relevant Documentation: https://toolset.com/documentation/user-guides/cred-user-forms/

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

This topic contains 10 replies, has 3 voices.

Last updated by Christian Cox 6 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#615632
error.jpg

I am trying to: Create 2 separate Edit Profile forms for Sales Agents and Brokers. Only the one for Sales Agent shows up.

Link to a page where the issue can be seen: amonsagana.erwinfrancis.com/media-kit/account-details

I expected to see: Both working

Instead, I got: Only the Sales Agent form to show up

#615711

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Erwin,

Thank you for contacting our support forum.

I see from your screenshot that your Agent Profile form has not been assigned to edit a role.

Could you edit this form and set the role settings and see if this helps.
Thanks,
Shane

#615877

Hi Shane,

Thanks for your response. The Agent Profile is actually the one that's working. I'm having problems with the Broker Profile.

I added these codes to the Account Detail page.

[toolset_access role="Sales Agent" operator="allow"]
[cred_user_form form="agent-profile"]
[/toolset_access]

[toolset_access role="Broker" operator="allow"]
[cred_user_form form="broker-profile"]
[/toolset_access]

#616052

Hi, Shane is unavailable today so he asked me to take this ticket. I hope that's okay with you. Let's try to narrow down the problem.
- Place the CRED form shortcodes without any conditionals to see if both CRED forms appear for both Users.

Sales agent form: [cred_user_form form="agent-profile"]
Broker form: [cred_user_form form="broker-profile"]

- If both forms appear for both Users, we know the issue is likely with the conditionals.
- If not, we need to look more closely at the permissions associated with each CRED form in Access Controls, since these settings control who can see which forms. Please go to Toolset > Access Control > CRED forms tab, and find the column that corresponds to this form. Take a screenshot showing the permissions for each role and include it in your reply.

#618508

Hi Christian and Shane,

Now my client is asking me for just one form that requires admin approval. Any ideas on how I could achieve that? They want to be able to receive emails for new user registration and approve them manually.

#618770

One way to accomplish this is to use a custom User Role in Access, like "Pending Approval". Set your CRED form to create Users and assign them with this custom Role. Use Access Controls as needed to restrict Pending Users from accessing your site. Use the email notification system in this CRED form to inform admins that a new User has been created, and is pending their approval. Then the admin can go into wp-admin and modify the User's Role as needed if they approve.

#618952

I appreciate the response Christian but can you be more specific on how to exactly achieve that? More specific steps please. Thanks.

#619437

Hi guys, I'm nearing my deadline already and I need feedback on this fast. Please get back to me ask soon as possible. Thanks.

#619483

Here are the general steps:
- Go to Toolset > Access Controls > Custom Roles tab.
- Create a new Custom Role called "Pending Approval", copying privileges from the Guest user role.
- Create a new CRED form that creates New Users. Select the "Pending Approval" role, so all Users created by this form will have the role "Pending Approval".
- Use the Auto-generate form button in the form editor to generate the code for this form. All the appropriate CRED fields will be inserted automatically.
- In the Email Notifications section of the form editor, create an Email Notification that will be sent to the appropriate Admin User(s) whenever this form is submitted. For testing purposes, include your own email address here too. Add the message of your choice indicating that a User is now pending their approval.
- Insert the CRED form on your site in a location that is accessible to Guests.
- Test the form out by visiting the site as a Guest and submitting the form. A new User should be created with the role "Pending Approval". You should be able to see this User in wp-admin when you're logged in as Administrator.
- Check your email to confirm the pending user notification was delivered as expected.

The next steps will vary based on the site as it is currently configured, and how Guest restriction to the site has been implemented so far. You can find more information about using Access Control here:
https://toolset.com/documentation/user-guides/setting-access-control/
https://toolset.com/documentation/user-guides/limiting-read-access-specific-content/
https://toolset.com/documentation/user-guides/access-control-texts-inside-page-content/
https://toolset.com/documentation/user-guides/access-control-for-cred-forms/

If there is a specific part of this process that you're having trouble with, please let me know and we can discuss in more detail.

#620752

Thanks Christian, really appreciate it. Now once I switch the Pending Approval to Subscriber, is there a way to send them emails with their login credentials and letting them know they are already approved?

#620767

There is not currently a way to trigger an email notification when a role change takes place in wp-admin, but you could use another CRED form to trigger a notification. You would have to set up an Edit User CRED form that allows Admins to modify User roles. Place that Edit User CRED form somewhere on your site that is accessible to Admins only. Use the CRED email notification feature to send an email with the desired information when the form is submitted. In an Edit User CRED form email notification, you can send a "Reset Password" link but not the actual password. A Create User CRED form is the only type of User form that allows you to send the raw password. So if it's necessary to send a raw password, the New User CRED form must send the notification.
https://toolset.com/documentation/user-guides/automated-email-notifications-with-cred/