No one here who has an idea? Or have I expressed myself incomprehensibly?
Hi @terpentin
I understand that since upgrading to WooCommerce 6.0.0 a particular custom email is not getting sent though all transactional emails are getting sent.
You’d want to check if that custom email is being correctly generated or not, by installing a plugin like WP Mail Logging.
Let us know how it goes.
Hi,
the same problem on WooCommerce 6.0.0
I look like the “trigger” isn’t trigger.
function kia_wc_add_order_meta_box_action( $actions ) {
global $theorder;
// ADD "Email class details" CUSTOM ACTION
$actions['kia_email_class_detail_action'] = __( 'Custom email send', 'kia_class' );
function kia_custom_woocommerce_email_actions( $actions ){
$actions[] = 'woocommerce_order_action_kia_email_class_detail_action';
return $actions;
}
add_filter( 'woocommerce_email_actions', 'kia_custom_woocommerce_email_actions' );
add_action( 'woocommerce_order_action_kia_email_class_detail_action', array( $this, 'trigger' ) );
return $actions;
}
-
This reply was modified 4 years, 4 months ago by
cavalihno.
-
This reply was modified 4 years, 4 months ago by
cavalihno.
-
This reply was modified 4 years, 4 months ago by
cavalihno.
Hi @margaretwporg
thanks for your help.
I installed the plugin you mentioned, but it only shows me, what I already know.
Transactional and the common emails from the dropdown are sent.
In the functions.php from my theme, the “woocommerce_order_action_…” is executed (it adds me a note to the order). Also, the constructor who extends the WC_Email class is executed correctly every page load (I added error_log(“Test”); ). I also added transactional triggers to the constructor of my custom email class, like copied below. Then the Mail is sent one time by creating the order, but by selecting the “custom dropdown mail” / triggering the “woocommerce_order_action_…” it doesn’t get sent.
// Triggers for this email.
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_failed_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_cancelled_to_on-hold_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_on-hold_to_processing_notification', array( $this, 'trigger' ), 50, 2 );
add_action( 'woocommerce_order_action_mahnung', array( $this, 'trigger' ) );
Hi there,
This is more of a development-oriented issue and we do not provide support for custom coding on these forums. WooCommerce core forum only covers support for the default features and functionality that come with WooCommerce.
You can check what’s been updated in WooCommerce 6.0 here:
https://developer.woocommerce.com/2021/12/15/woocommerce-6-0-released/
If you need more help trying to figure out what changes you should make to your custom code, I recommend you visit the official WooCommerce Facebook Group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.
Thanks.
Hi everyone,
I solved the problem in the following manner: I don’t trust the trigger in the Email class, so I deleted it here. Then I added the following code in my functions to trigger the email there:
function mahnung_order_meta_box_action( $order ) {
//$message = "Mahnung gesendet.";
//$order->add_order_note( $message );
$mails = WC()->mailer()->get_emails();
if ( isset( $mails['WC_Mahnung_Email_Manual'] ) ) {
$mails['WC_Mahnung_Email_Manual']->trigger( $order );
}
}
add_action( 'woocommerce_order_action_mahnung', 'mahnung_order_meta_box_action' );
Thanks for letting us know!
Thank you for sharing your solution that would help in case anyone else has a similar inquiry.
I’ll mark this thread as resolved. If you have any further questions, I recommend creating a new thread.