I have a question about the emails that are sent when you approve or reject a B2B account.
First: When you apply to be a B2B customer, you recive an email with a link to set your password, ect. But when the account is not approved yet so they can’t login to the site. Is there an option that when they apply they can already get access to their account but only as on B2C costumer until approval?
Second: When they are approved for B2B they get the same email as when you approve there account for B2C. Is it possible to differentiate in emails where they get approved for B2b or B2C? When the first question would be possible this is something that may not be necessary.
Tirth: When you reject somebody they will never get an email. Is there an option that you can let them know their application is rejected? Even when the first question would work, when you reject them to be a B2B customer they get an email of rejection.
First: When you apply to be a B2B customer, you recive an email with a link to set your password, ect. But when the account is not approved yet so they can’t login to the site. Is there an option that when they apply they can already get access to their account but only as on B2C costumer until approval?
In general, what we recommend here is to allow the customer to directly choose their password during registration, rather than use the password link option. Indeed when using approval the password link flow doesn't work that well.
To allow customers to directly choose their password during registration, you can disable the following setting in WooCommerce -> Settings -> Accounts: https://prnt.sc/HqiNz7sQG0y5
It is also possible to allow customers to access their account as a B2C customer until approval. For that, please enable the setting 'Existing users can apply' in B2BKing -> Settings -> Registration: https://prnt.sc/FgMrJEiZQ6uq
Second: When they are approved for B2B they get the same email as when you approve there account for B2C. Is it possible to differentiate in emails where they get approved for B2b or B2C?
If you decide to go this route, let me know and I will send more details as to how you can differentiate between B2B and B2C in the PHP template code.
Tirth: When you reject somebody they will never get an email. Is there an option that you can let them know their application is rejected?
It is possible to add an email for this, by adding this PHP code snippet to your site:
add_action('b2bking_reject_user_admin_before_delete', function($user_id){
$user = new WP_User($user_id);
$user_email = $user->user_email;
$message = 'Thank you for taking the time to register, however, we were unable to approve your application...';
do_action( 'b2bking_new_message', $user_email, $message, get_current_user_id(), 0 );
}, 10, 1);
You can customize the $message content per your needs.
Something I'd like to mention: For this to work, it is necessary to enable the email in WooCommerce -> Settings -> Emails -> New message / conversation (this snippet uses that email).
The first question is solved, this works perfectly.
For the second question: I would like to get some more information on how to differentiate the 2 emails.
For the third question, this works but I have one remark. If you reject the approval, the account is also deleted. Is there an option that if you reject the approval it stays a B2C account? This would also make the second question not necessary.
But if that’s not possible we can put a reject message if we approve them just for B2C.
(2) I added the given code to php Snippet but I got the error “Attempt to read property "ID" on false”
And also how can I add content? With the Echo routine?
(3) I updated the plugin to the attached version, Can I just update when the next official release comes? And do I have to use the code snippet that you provided when the new realise comes?
I tested it and it works perfectly.
Only when you reject the user in his account, he still get the message that his approval is pending although he is rejected.
And for the email he gets for his rejection, you made the code snippet so that it shows the User and the Message.
To not show the user name can I just delete $user = new WP_User($user_id); ? And to not show the “Message” Can I also use the Echo routine?
Hello,
I have a question about the emails that are sent when you approve or reject a B2B account.
First: When you apply to be a B2B customer, you recive an email with a link to set your password, ect.
But when the account is not approved yet so they can’t login to the site.
Is there an option that when they apply they can already get access to their account but only as on B2C costumer until approval?
Second: When they are approved for B2B they get the same email as when you approve there account for B2C.
Is it possible to differentiate in emails where they get approved for B2b or B2C?
When the first question would be possible this is something that may not be necessary.
Tirth: When you reject somebody they will never get an email.
Is there an option that you can let them know their application is rejected?
Even when the first question would work, when you reject them to be a B2B customer they get an email of rejection.
Thank you in advance and best regards,
Timothy
Hello Timothy,
First: When you apply to be a B2B customer, you recive an email with a link to set your password, ect.
But when the account is not approved yet so they can’t login to the site.
Is there an option that when they apply they can already get access to their account but only as on B2C costumer until approval?
In general, what we recommend here is to allow the customer to directly choose their password during registration, rather than use the password link option. Indeed when using approval the password link flow doesn't work that well.
To allow customers to directly choose their password during registration, you can disable the following setting in WooCommerce -> Settings -> Accounts: https://prnt.sc/HqiNz7sQG0y5
It is also possible to allow customers to access their account as a B2C customer until approval. For that, please enable the setting 'Existing users can apply' in B2BKing -> Settings -> Registration: https://prnt.sc/FgMrJEiZQ6uq
Second: When they are approved for B2B they get the same email as when you approve there account for B2C.
Is it possible to differentiate in emails where they get approved for B2b or B2C?
This is possible, but you would need to copy the .php email template to your child theme and edit it there. This process of customizing templates is explained in more detail here: https://woocommerce-b2b-plugin.com/docs/how-to-customize-b2bking-emails/
If you decide to go this route, let me know and I will send more details as to how you can differentiate between B2B and B2C in the PHP template code.
Tirth: When you reject somebody they will never get an email.
Is there an option that you can let them know their application is rejected?
It is possible to add an email for this, by adding this PHP code snippet to your site:
You can customize the $message content per your needs.
This snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
Something I'd like to mention: For this to work, it is necessary to enable the email in WooCommerce -> Settings -> Emails -> New message / conversation (this snippet uses that email).
Kind regards,
Stefan
Hello Stefan,
Thank you for the extended and detailed answer.
The first question is solved, this works perfectly.
For the second question: I would like to get some more information on how to differentiate the 2 emails.
For the third question, this works but I have one remark. If you reject the approval, the account is also deleted.
Is there an option that if you reject the approval it stays a B2C account?
This would also make the second question not necessary.
But if that’s not possible we can put a reject message if we approve them just for B2C.
Best regards,
Timothy
Hello,
Thank you for your support.
(2) I added the given code to php Snippet but I got the error “Attempt to read property "ID" on false”
And also how can I add content? With the Echo routine?
(3) I updated the plugin to the attached version, Can I just update when the next official release comes?
And do I have to use the code snippet that you provided when the new realise comes?
I tested it and it works perfectly.
Only when you reject the user in his account, he still get the message that his approval is pending although he is rejected.
And for the email he gets for his rejection, you made the code snippet so that it shows the User and the Message.
To not show the user name can I just delete $user = new WP_User($user_id); ?
And to not show the “Message” Can I also use the Echo routine?
Best regards,
Timothy