Hi Thanks for the reply i tried this code but it doesn't seem to be working.
i used this code in a plugin called code snippet
As a test: I filled out the registration form and received the mail like (Your application is on hold) but even after rejecting the user, I'm not getting the mail of the user rejected. I also i checked the Mail log and i didn't see any mail related to it. Also, I would like to use the same template I'm using with all of my email
Similar to the template i m using with this email ( Email user received after getting approved )
if (!empty($first_name)){ echo esc_html__('Hi ','b2bking').$first_name; echo '<br>'; } ?> <p> <?php esc_html_e( 'Congratulations! Your account has been approved.', 'b2bking'); ?> <br> <br> https://mysite.com/my-account/"> esc_html_e( 'Click here to login', 'b2bking' ); ?> </p>
<?php
/** * Show user-defined additional content - this is set in each email's settings. */ if ( $additional_content ) { echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) ); }
Can you please clarify, are you using the B2BKing Core plugin (free version), or the B2BKing Pro one? It may be related to why the snippet is not working.
I am not sure why the snippet did not work. Please check that you already have the latest version of B2BKing Pro installed, that is currently version 4.7.10.
Hi i would like to know how to send the email to the user when admin rejects the user's application in b2bking
I want email to have something like
"Thank you, but you are not eligible for our B2B program."
Hi Abhi,
Thank you for getting in touch,
You could add this PHP code snippet to your site to achieve that:
A PHP 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/
It will send the user a message using B2BKing's "new message" emails.
Kind regards,
Stefan
Hi Thanks for the reply i tried this code but it doesn't seem to be working.
i used this code in a plugin called code snippet
As a test: I filled out the registration form and received the mail like (Your application is on hold) but even after rejecting the user, I'm not getting the mail of the user rejected. I also i checked the Mail log and i didn't see any mail related to it. Also, I would like to use the same template I'm using with all of my email
Similar to the template i m using with this email ( Email user received after getting approved )
<?php
defined( 'ABSPATH' ) || exit;
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email );
$user = get_user_by('email', $email->recipient);
$first_name = get_user_meta($user->ID, 'billing_first_name', true);
if (!empty($first_name)){
echo esc_html__('Hi ','b2bking').$first_name;
echo '<br>';
}
?>
<p>
<?php esc_html_e( 'Congratulations! Your account has been approved.', 'b2bking'); ?>
<br>
<br>
https://mysite.com/my-account/"> esc_html_e( 'Click here to login', 'b2bking' ); ?>
</p>
<?php
/**
* Show user-defined additional content - this is set in each email's settings.
*/
if ( $additional_content ) {
echo wp_kses_post( wpautop( wptexturize( $additional_content ) ) );
}
/*
* @hooked WC_Emails::email_footer() Output the email footer
*/
do_action( 'woocommerce_email_footer', $email );
Can you please clarify, are you using the B2BKing Core plugin (free version), or the B2BKing Pro one? It may be related to why the snippet is not working.
Currently both are installed on the site
Thank you for clarifying.
I am not sure why the snippet did not work. Please check that you already have the latest version of B2BKing Pro installed, that is currently version 4.7.10.
If you do not, please make sure to update: https://woocommerce-b2b-plugin.com/docs/how-to-update-b2bking-to-the-latest-version/
We can also check this directly on your site if you would like to troubleshoot directly.
For that please provide us with your license key / purchase code for the plugin and your site's or staging site's access details.
Kind regards,
Stefan