attach a PDF on a completed order email
-
Hi there,
I want to sometimes, send a PDF on the completed order email.
I created a child theme, using a plugin that makes the job. And after searching I found this code that I’m pasting after this : // END ENQUEUE PARENT ACTION on my functions.php child theme.
On the parent theme functions.php it is working, but when I paste on child it doesn’t.add_filter( 'woocommerce_email_attachments', 'attach_terms_conditions_pdf_to_email', 10, 3); function attach_terms_conditions_pdf_to_email ( $attachments, $status , $order ) { $allowed_statuses = array( 'customer_completed_order' ); if( isset( $status ) && in_array ( $status, $allowed_statuses ) ) { $pdf_name = get_post_meta( get_the_id(), 'email_fatura', true ); $pdf_path = get_home_path() . '/Faturas/GestaoDespesas/' . $pdf_name; $attachments[] = $pdf_path; } return $attachments; }
Thank you in advance for any kind of help!
- This topic was modified 3 years, 11 months ago by .
- This topic was modified 3 years, 11 months ago by .
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘attach a PDF on a completed order email’ is closed to new replies.