mirror of
https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2025-08-17 18:11:08 +08:00
Create woocommerce-order-action-resend-completed.php
This commit is contained in:
parent
59f88503d0
commit
1007d54752
1 changed files with 28 additions and 0 deletions
28
mu-plugins/woocommerce-order-action-resend-completed.php
Normal file
28
mu-plugins/woocommerce-order-action-resend-completed.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Plugin Name: WooCommerce resend order completed notification
|
||||
* Plugin URI: https://github.com/szepeviktor/wordpress-website-lifecycle
|
||||
*/
|
||||
|
||||
add_filter(
|
||||
'woocommerce_order_actions',
|
||||
static function ($actions) {
|
||||
$actions['resend_order_completed'] = 'Resend order completed notification';
|
||||
return $actions;
|
||||
},
|
||||
11,
|
||||
1
|
||||
);
|
||||
|
||||
add_action(
|
||||
'woocommerce_order_action_resend_order_completed',
|
||||
static function (\WC_Order $order) {
|
||||
WC()->payment_gateways();
|
||||
WC()->shipping();
|
||||
WC()->mailer()->emails['WC_Email_Customer_Completed_Order']->trigger($order->get_id(), $order);
|
||||
$order->add_order_note('Order completed notification resent to customer.', false, true);
|
||||
},
|
||||
10,
|
||||
1
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue