简体   繁体   中英

How to send Customer invoice / Order details email notification Automatically In Woocommerce

I want to send Customer invoice / Order details email notification Automatically In Woocommerce.When i checking Customer invoice / Order email notification in woocommerce it have only way to send Customer invoice / Order email manually.I want to send Customer invoice / Order email notification when order status is pending payment.If there any function is available send Customer invoice / Order email automatically.Could You Please Help Me.

在此处输入图片说明

Thanks in advance!!!!!!

Use the woocommerce_email_headers filter with a condition that matches the Customer invoice / Order details email.

Make sure you set the email addresses like <your@email.com> as your@email.com alone failed for me.

function add_bcc_to_certain_emails( $headers, $object ) {

    $bcc_emails = '<your@email.com>, <another@email.com>';      

    // email types/objects to add bcc to
    $add_bcc_to = array(
        'customer_invoice',//for the manually triggered Customer invoice / Order details email
    );

    // if our email object is in our array
    if ( in_array( $object, $add_bcc_to ) ) {
        // change our headers
        $headers = array( 
            $headers,
            'Bcc: '.$bcc_emails.'\r\n',
            );
    }

    return $headers;
}


add_filter( 'woocommerce_email_headers', 'add_bcc_to_certain_emails', 10, 2 );

Snippet amended from https://jessepearson.net/2016/10/adding-bcc-emails-woocommerce/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM