Skip to content

Commit

Permalink
Adds polylang support for sending emails
Browse files Browse the repository at this point in the history
  • Loading branch information
vdrnn committed Jun 15, 2023
1 parent 754d84f commit 47e64a9
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions includes/class-wc-postfinancecheckout-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,39 @@ public static function add_email_actions( $actions ) {
}
}
}

if(class_exists('PLLWC')){
add_filter( 'pllwc_order_email_actions', function ( $actions ){
$all = array(
'woocommerce_order_status_postfi-redirected_to_processing',
'woocommerce_order_status_postfi-redirected_to_completed',
'woocommerce_order_status_postfi-redirected_to_on-hold',
'woocommerce_order_status_postfi-redirected_to_postfinancecheckout-waiting',
'woocommerce_order_status_postfi-redirected_to_postfinancecheckout-manual',
'woocommerce_order_status_postfi-manual_to_cancelled',
'woocommerce_order_status_postfi-waiting_to_cancelled',
'woocommerce_order_status_postfi-manual_to_processing',
'woocommerce_order_status_postfi-waiting_to_processing',
'woocommerce_order_status_postfi-redirected_to_processing_notification',
'woocommerce_order_status_postfi-redirected_to_completed_notification',
'woocommerce_order_status_postfi-redirected_to_on-hold_notification',
'woocommerce_order_status_postfi-redirected_to_postfinancecheckout-waiting_notification',
'woocommerce_order_status_postfi-redirected_to_postfinancecheckout-manual_notification',
);

$customers = array(
'woocommerce_order_status_postfi-manual_to_processing_notification',
'woocommerce_order_status_postfi-waiting_to_processing_notification',
'woocommerce_order_status_on-hold_to_processing_notification',
'woocommerce_order_status_postfi-manual_to_cancelled_notification',
'woocommerce_order_status_postfi-waiting_to_cancelled_notifcation',
);

$actions = array_merge( $actions, $all, $customers);
return $actions;
});
}

$actions = array_merge( $actions, $to_add );
return $actions;
}
Expand Down

0 comments on commit 47e64a9

Please sign in to comment.