The way it works by default is that there is only 1 email (this is a standard WooCommerce email, not from our plugin). And our plugin adds an extra text for users that need manual approval, notifying them. You can also edit this text.
This text can be changed by using a filter. It's as simple as adding this code snippet:
add_filter('b2bking_new_account_email_approval_notification', function($text){
return 'Your Text Here';
});
However, this is complex custom work and it's not something we can do directly for you as part of support - however if you or your team is familiar with coding, I'm happy to provide any technical info you would need.
You could modify that text by using a translation plugin such as Loco Translate and creating a translation (even if you are not actually changing the language). You can create an English translation if the site language is English, and that simply means your translation overwrites the default texts.
With Loco I set translated that line for the WooCommerce plugin:
The result is that the line is replaced by the "-" symbol in the email
You can find a guide for how to translate WooCommerce with Loco Translate here:
I have 2 kind of clients in my webshop:
1. Regular clients
2. B2B clients
1. Regular clients can directly use their account, but 2. B2B clients needs to get an approval first first.
When a client signs up, there is only 1 email in Woocomerce - Settings - Emails:
"New account"
This email is sent to 1. Regular clients and 2. B2B clients, but I want to have a different email template for that. How can I add another email?
Thank you in advance
Hi Yvon,
Thank you for purchasing the plugin,
1)
The way it works by default is that there is only 1 email (this is a standard WooCommerce email, not from our plugin). And our plugin adds an extra text for users that need manual approval, notifying them. You can also edit this text.
This text can be changed by using a filter. It's as simple as adding this code snippet:
To Add A Snippet: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
2)
If you want to have an entirely different email / template, that can be achieved but it's a lot harder and requires custom coding work.
I think the way to do it would be to create 2 php templates and then filter which one is the one that's loaded (via a filter such as 'woocommerce_locate_template'). Some more info: https://stackoverflow.com/questions/59097318/how-to-set-a-woocommerce-email-template-as-default-for-all-emails
However, this is complex custom work and it's not something we can do directly for you as part of support - however if you or your team is familiar with coding, I'm happy to provide any technical info you would need.
Kind regards,
Stefan
Thank you for your reply.
If we go for option 1; can we also change the location of the text? I want to display this more in the beginning of the default email.
Thank you in advance,
Hi Yvon,
I checked, there are 2 hooks: footer and header.
If you'd like, you can place it at the beginning of the email by using the header hook.
To do that, add this snippet to your site:
With the above snippet, you no longer need the previous snippet, you can directly change the text in the above.
Other than this, I can't control the position further as there are just the 2 hooks. For more control you would need to modify the .php template .
Kind regards,
Stefan
Ok thank you. 1 last question: Can we remove the existing / default content (inside blue box) ?
You could modify that text by using a translation plugin such as Loco Translate and creating a translation (even if you are not actually changing the language). You can create an English translation if the site language is English, and that simply means your translation overwrites the default texts.
With Loco I set translated that line for the WooCommerce plugin:
The result is that the line is replaced by the "-" symbol in the email
You can find a guide for how to translate WooCommerce with Loco Translate here:
https://docs.woocommerce.com/document/woocommerce-localization/
Kind regards,
Stefan
One other question. Where can we edit this email? I can't access it with the same hook.
Hi,
This email is added by our plugin,
You can modify it in 2 ways:
1. Add a snippet such as:
Effect:
2. Copy wp-content/plugins/b2bking/emails/templates/your-account-approved-email-template.php
to your theme folder (such as wp-content/themes/storefront/)
Then you can modify it directly under the theme folder.
Kind regards,
Stefan