Woocommerce Email dynamic attachments
-
Hi people,
I would ask you for your help. I want to send pdf invoices, which are generated with my invoice creating software and saved and uploaded as a pdf.
So the idea is to create the invoice as a pdf, save it and upload it with a specific name for instance invoice_”ordernumber”.pdf and send it with the “order completed” email.
I have the following code://Filter-Hook für Woocommerce add_filter( 'woocommerce_email_attachments', 'widerrufsbelehrung_email', 10, 3); function widerrufsbelehrung_email ( $anhang, $status , $bestellung ) { $anhang_bei_status = array( 'customer_completed_order' ); if( isset( $status ) && in_array ( $status, $anhang_bei_status ) ) { $widerrufsbelehrung = get_template_directory() . '/PDF/Widerrufsbelehrung.pdf'; $anhang[] = $widerrufsbelehrung; } return $anhang; }
My question: how could I change the static attachment with a dynamic one?
How can I applyget_order_number()
Many thanks in advance
Bests
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Woocommerce Email dynamic attachments’ is closed to new replies.