/**
* Add credit note email to order actions list
*/
public function pro_email_order_actions($available_emails)
{
global $post_id;
$order_notification_settings = get_option('woocommerce_pdf_order_notification_settings');
if (isset($order_notification_settings['recipient']) && !empty($order_notification_settings['recipient'])) {
// only add order notification action when a recipient is set!
$available_emails[] = 'pdf_order_notification';
}
if (version_compare(WOOCOMMERCE_VERSION, '2.2', '>=')) {
$order = new WC_Order($post_id);
$refunds = $order->get_refunds();
if (!empty($refunds)) {
$available_emails[] = 'customer_credit_note';
}
}
return $available_emails;
}