Hey,
You can use a code like this:
add_filter( 'kadence_woomail_order_body_text', 'custom_email_placeholder', 15, 5 );
function custom_email_placeholder( $body_text, $order, $sent_to_admin, $plain_text, $email ) {
if ( $order ) {
$body_text = str_replace( '{customer_email}', $order->get_billing_email(), $body_text );
}
return $body_text;
}
Hi Ben,
I added the code to function.php and when I tried to add the {customer_email} shortcode. It doesnt work.
Which email are you wanting to show this in?
Ben
Hi ben, i want to show this in customer new account email
ok, thats a little different then order emails. You would need to use code like this:
add_filter( 'kadence_woomail_no_order_body_text', 'custom_email_placeholder_no_order', 15, 2 );
function custom_email_placeholder_no_order( $body_text, $email ) {
if ( is_a( $email->object, 'WP_User' ) ) {
$body_text = str_replace( '{customer_email}', $email->object->user_email, $body_text );
}
return $body_text;
Thank you Ben it’s now working! Thanks for the great plugin