• Hello,
    I’m using Email It In to store all invoices in the Google Drive. I noticed, that not only invoices are sent there. I also found out, that our Terms & Conditions are stored in Google Drive too for each order.

    To add Terms and Condition as PDF into our email, I’m using this code:

    add_filter( 'woocommerce_email_attachments', 'bbloomer_attach_pdf_to_emails', 10, 4 );
     
    function bbloomer_attach_pdf_to_emails( $attachments, $email_id, $order, $email ) {
        $email_ids = array( 'new_order', 'customer_processing_order', 'customer_on_hold_order' );
        if ( in_array ( $email_id, $email_ids ) ) {
            $upload_dir = wp_upload_dir();
            $attachments[] = $upload_dir['basedir'] . "/name-of-the-file.pdf";
        }
        return $attachments;
    }
    

    What do I need to do to keep this file from being emailed into Email It In?

    Thanks for your help.

  • The topic ‘Email It In + woocommerce_email_attachments’ is closed to new replies.