• Resolved codylt

    (@codylt)


    Hello,

    Is it possible to add generated pdf number (For example 001, 002 etc) in email subject to admin and customer?
    As now, if we receive cart email, and theres a lot of them, it’s very difficult to find the required email if the client calls us (or we want to call the client). So simple – “Cart no – number” in subject would be awesome, how can we achieve it if its possible?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author CloudCatch

    (@cloudcatch)

    Hello

    You can add the cart number to your email subject by adding something like the below to your child theme functions.php file or in a code snippet:

    add_filter( 'wc_cart_pdf_admin_copy_subject', function( $subject ) {
    $incremented_num = absint( get_option( 'wc_cart_pdf_unique_increment_num', 1 ) );

    $subject = sprintf( esc_html__( 'Cart Number: %s' ), sprintf( '%04d', $incremented_num ) );

    // $subject = sprintf( esc_html__( 'Cart Number: %d' ), $incremented_num ); // Non formatted string

    return $subject;
    } );

    Hope this helps

    Thread Starter codylt

    (@codylt)

    Thanks it works perfectly!
    One more question, how can i change so the email will send to another email and not admin email. I found the function to add more emails, but it still sends to original admin email too.

    Plugin Author David Jensen

    (@dkjensen)

    @codylt

    Use the below, it will not add the admin as a recipient

    add_filter( 'wc_cart_pdf_admin_copy_email', function( $emails ) {
    return array( '[email protected]' );
    } );
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.