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.
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.
- 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.
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.
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.
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.
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?
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/