add_action('woocommerce_email_after_order_table', 'add_order_email_instructions', 10, 2);
function add_order_email_instructions($order, $sent_to_admin) {
if (!$sent_to_admin) {
if ( isset( $gateways['cod'] ) == $order->get_payment_method()) {
// cash on delivery method
do_action('woocommerce_thankyou_lieferung', $order->get_id());
} else {
// other methods (ie credit card)
do_action('woocommerce_thankyou_lieferung', $order->get_id());
}
}
}