We have the B2BKing and Sales King installed for our shop.
The process is that new B2B clients require a manual approval. During their registration process, they can select a Sales Agent via the Agent ID.
Would it be possible that the selected agent receives the New customer requires approval email and can approve the customer. And the default email address gets the email when no agent is selected?
I believe I can help with a custom code snippet to make the selected agent get the "New customer requires approval" email as you suggested.
However, regarding the approval functionality, there's a bit of a challenge since by default, agents don't have access to the backend user profile page where customer approval takes place.
Would it be a workable solution for you if we: 1. Set up the email notifications to go to the selected agent 2. Give agents permission to edit users assigned to them in the WordPress admin panel? This would allow them to handle the approval process directly, but also some restricted admin backend access.
The agents wouldn't necessarily need a specific role - they could use the default 'Customer' role, and we would add custom permissions via code to allow them to edit users assigned to them.
To implement this properly and ensure everything works smoothly with your specific setup, would you be able to share backend access to your site or a staging site? Different sites often have varying permission configurations, and I want to make sure the solution I provide works for your specific case.
This takes care of both sending the email to the agent, and then allowing the agent to edit the user in the backend so they can approve the user.
In the snippet, we need to specify the role of agents (currently "default_wholesaler"). Please note that if agents are given a different role than default_wholesaler you will need to update the snippet,
I tested that code on the staging site and I believe it is working. Let me know if you run into any issues,
Hi,
We have the B2BKing and Sales King installed for our shop.
The process is that new B2B clients require a manual approval. During their registration process, they can select a Sales Agent via the Agent ID.
Would it be possible that the selected agent receives the New customer requires approval email and can approve the customer. And the default email address gets the email when no agent is selected?
Thanks//Andreas
Hi Andreas,
Glad to assist,
I believe I can help with a custom code snippet to make the selected agent get the "New customer requires approval" email as you suggested.
However, regarding the approval functionality, there's a bit of a challenge since by default, agents don't have access to the backend user profile page where customer approval takes place.
Would it be a workable solution for you if we:
1. Set up the email notifications to go to the selected agent
2. Give agents permission to edit users assigned to them in the WordPress admin panel? This would allow them to handle the approval process directly, but also some restricted admin backend access.
Kind regards,
Stefan
Hi Stefan,Thanks for your answer.
This could be an option. What would be the role the agent would get to reach the backend?
//Andreas
Hi Andreas,
The agents wouldn't necessarily need a specific role - they could use the default 'Customer' role, and we would add custom permissions via code to allow them to edit users assigned to them.
To implement this properly and ensure everything works smoothly with your specific setup, would you be able to share backend access to your site or a staging site? Different sites often have varying permission configurations, and I want to make sure the solution I provide works for your specific case.
Kind regards,
Stefan
Yes, that would be perfect!
Hi Andreas,
I looked into this now on the site and I believe I have completed it successfully.
This is the code snippet that handles it:
On your live site, it has to be added to the code snippets plugin.
On the staging site, I added it here:
https://staging3.sigtunastearinljusfabrik.se/wp-admin/admin.php?page=edit-snippet&id=10
This takes care of both sending the email to the agent, and then allowing the agent to edit the user in the backend so they can approve the user.
In the snippet, we need to specify the role of agents (currently "default_wholesaler"). Please note that if agents are given a different role than default_wholesaler you will need to update the snippet,
I tested that code on the staging site and I believe it is working. Let me know if you run into any issues,
Kind regards,
Stefan