This thread is resolved. Here is a description of the problem and solution.
Problem:
You are experiencing an issue where email notifications are not being sent when using 'Bulk Actions' on the order page due to a conflict between the WPML string plugin and your order plugin. This conflict arises because both plugins use the
woocommerce_order_status_changed
hook, and the WPML-related code switches the locale to English, interrupting the email sending process.
Solution:
We recommend adding the following code snippet to your theme's functions.php file after ensuring you have a full backup:
add_action('woocommerce_order_status_changed', function () {<br /> $tag = 'woocommerce_order_status_changed';<br /> $prio = 10;<br /><br /> $callbacks = $GLOBALS['wp_filter'][$tag]->callbacks[$prio] ?? [];<br /> foreach ($callbacks as $cb) {<br /> $f = $cb['function'];<br /> if (is_array($f) && is_object($f[0]) && $f[1] === 'comments_language') {<br /> remove_action($tag, $f, $prio);<br /> }<br /> }<br />}, 0);This code removes the WCML action that changes the locale when the other plugin calls
restore_previous_locale()
. With this adjustment, the process should complete correctly, and your emails will be sent as expected.
Please note that this solution might become irrelevant due to updates or may not apply to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.