Woocommerce : How to attach an custom attachment with customer-processing-order.php email template [closed]

I want to attach an PDF file with “customer-processing-order.php” email template when any customer place an order.

Please find below my code that i already used to attach an attachment with above email.

add_filter( 'woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 3);
function attach_terms_conditions_pdf_to_email ( $attachments , $id, $object ) {
    $pdf_path="pdf_file_path.pdf";
    $attachments[] = $pdf_path;
    return $attachments;

}

0

Leave a Comment