Hi! The PDF Invoices & Packing Slips plugin does not send emails, that’s WooCommerce territory.
There’s an hook that you can utilize to execute a function when the order is completed, woocommerce_order_status_completed
.
To make this more versatile, you can use the action that is triggered for each status change, woocommerce_order_status_changed
. Here’s an example:
add_action( 'woocommerce_order_status_changed', 'woocommerce_order_status_changed_action', 10, 3 );
function woocommerce_order_status_changed_action( $order_id, $old_status, $new_status ) {
if( $new_status == "completed" ) {
$order = wc_get_order( $order_id );
$payment_method = $order->get_payment_method();
// Do your magic here
}
}
This is beyond the scope of this free plugin support, but hopefully the above will get you on track with this!
Ewout