• Resolved technicalx

    (@technicalx)


    Is there any filters to add more merge tags to header and content? I am trying to add {customer_role} but having no luck

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter technicalx

    (@technicalx)

    got there eventually, here’s the code.

    // add a new tag for emails, customer_roles
    add_filter( 'kadence_woomail_order_body_text', function ($body_text, $order, $sent_to_admin, $plain_text, $email ) {
        $user = $order->get_user();
    	$user_roles = isset($user->roles) && is_array($user->roles) ? implode( ', ', $user->roles) : '';
    	$user_roles_msg = ($user_roles ? $user_roles : 'guest or new user');
    	$body_text = str_replace('{customer_roles}', $user_roles_msg, $body_text);
    
        return $body_text;
    }, 21, 5);
    hannah

    (@hannahritner)

    Glad you were able to resolve this! Thanks for sharing.

    Best,
    Hannah

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding more merge tags’ is closed to new replies.