Thanks I can’t seem to recreate, Which email type is this happening on?
Ben
Thread Starter
deyson
(@deyson)
It is happening on all of them.
Is there a shortcode for a customer’s email address? I figured out the First name.
Thank you.
You can add customers email as a placeholder, see this code:
add_filter( 'kadence_woomail_order_body_text', 'custom_function_for_billing_email', 10, 2 );
function custom_function_for_billing_email( $text, $order ) {
if ( is_a( $order, 'WC_Order' ) ) {
$text = str_replace( '{billing_email}', $order->get_billing_email(), $text );
}
return $text;
}
That would make {billing_email}the placeholder.
Can you tell me what other plugins you have installed? Also what theme you are using?
Ben
Thread Starter
deyson
(@deyson)
Hello, The code did not work, I added it to Functions.php. I get this result in my test email: User email: {billing_email}
I am using the Astra Pro theme and many other plugins.
Thank you.
Thread Starter
deyson
(@deyson)
The other thing is that when I request a new password on my website, I get a plain text email, not the beautiful new style I had created with your plugin.
Hey,
1. Are you testing with an order email. That code is not for new account emails since it’s the billing email not user email. It will only work on order emails.
2. If you request through WordPress Core then you will get core emails. If you request through Woocommerce then you will get woocommerce emails. This plugin doesn’t edit WordPress core emails. So you need to make sure you request from the woocommerce my-account page.
Ben
Thread Starter
deyson
(@deyson)
Hello.
I was testing with the lost password template.
It seems on the account page lost password link redirects to the WordPress core. I will see how I can fix it so it stays on the Woocommerce account page.
Thank you.
Thread Starter
deyson
(@deyson)
Hello,
I was able to figure out the issue so now the password reset is Woocommerce’s and not WordPress core.
However, now when I add the shortcode you had provided, it does not work. The Reset Password email shows this: {billing_email}
Please let me know what you think. Thank you and have an amazing day.
Hey,
Sorry if I wasn’t clear before.
That code is not for new account emails since itβs the billing email not user email. It will only work on order emails.
You would have to create a different placeholder for password emails that queried the user not the billing since it’s not an order email.
Ben
An example of that could be a function like this:
add_filter( 'kadence_woomail_no_order_body_text', 'custom_function_for_user_email', 10, 2 );
function custom_function_for_user_email( $text, $email ) {
if ( is_a( $email->object, 'WP_User' ) ) {
$text = str_replace( '{customer_email}', $email->object->user_email, $text );
}
return $text;
}
Thread Starter
deyson
(@deyson)
That worked! Thank you! π
Have an amazing day. P.S. I have been telling everyone about your plugin. I think it is the best and easiest way to make beautiful email templates. Keep up the great work! π
_Deyson