Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 5:00 – 13:00 5:00 – 13:00 5:00 – 13:00 5:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Tagged: 

This topic contains 14 replies, has 1 voice.

Last updated by Otto 3 weeks, 3 days ago.

Assisted by: Otto.

Author Posts
July 18, 2025 at 3:35 pm #17251433

Eva

<b>Background of the issue: </b>
I am trying to resolve an issue with WooCommerce Multilingual & Multicurrency (5.4.0) and WooCommerce Bookings (2.2.8) where I am experiencing incompatibility issues. Ticket reference: https://wpml.org/forums/topic/woocommerce-bookings-woocommerce-multilingual-multicurrency-multiple-emails-for-pending-reques/

<b>Symptoms: </b>
I expected to receive only one user email notification for pending reservations, but instead, I receive multiple emails when I make a reservation.

<b>Questions: </b>
Why am I receiving multiple emails for pending reservations?
How can I configure the system to send only one email notification for pending reservations?

I've found a fix that works for me that I would like to report.

July 21, 2025 at 1:01 am #17253499

Kor
WPML Supporter since 08/2022

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Hi Eva,

Thank you for reaching out to WPML support. While one of my colleagues reviews your ticket, I’d like to provide some initial debugging steps and see if I can assist you in the meantime.

Before we look into the fix you mentioned, could you please confirm whether you are testing with the latest version of WooCommerce Multilingual & Multicurrency 5.5.1? I noticed that you referred to version 5.4.0 in your initial message. The issue you reported should already be resolved, as noted in our errata here: https://wpml.org/errata/woocommerce-bookings-multiple-booking-confirmation-emails-sent-for-each-language/

Looking forward to your confirmation so we can proceed accordingly.

July 21, 2025 at 5:43 pm #17257045

Eva

Hi Kor,

my mistake, I meant WooCommerce Multilingual & Multicurrency 5.5.1.

In the preview ticket I’ve deactivated all plugins except WPML, String Translation, WCML, WooCommerce and WooCommerce Bookings and test it all with a WordPress standard theme but the problem was still there.

In the file …/wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/Emails.php file we’ve added a couple of fix that solved the issue.

Could it be useful if I share it with you what we've done?

July 23, 2025 at 7:53 pm #17265509

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Yes, that would be great! Please share with our team the steps you took to resolve this and we will review it further.

July 24, 2025 at 7:40 am #17266248

Eva

Hi Bobby,

here you go!

In the file …/wp-content/plugins/woocommerce-multilingual/compatibility/WcBookings/Emails.php we added:

After line 64

// FIX: include missing action
'woocommerce_booking_pending-confirmation_notification' => [ \WC_Email_Booking_Pending_Confirmation::class ],

And after line 186

// FIX: correctly persist the fact that we have already sent the email
$this->initialStates[ $class ] = 'no';

July 24, 2025 at 6:39 pm #17269046

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for sharing this with us!

I'd like to confirm as this will help me understand if this is a different case or a possible regression of the previous issue mentioned here:
https://wpml.org/errata/woocommerce-bookings-multiple-booking-confirmation-emails-sent-for-each-language/

The multiple emails that you received...are they constant reminders or different emails per active language on the site?

August 1, 2025 at 9:56 am #17287749

Eva

Hi Bobby,

sorry for my late reply,

I confirm that the multiple emails received are always 3 (as the number of languages of the website) and the bookable product is translated.

The 3 emails sent are all in Italian (the main language and the one chosen for the purchase), not translated (see screenshot attached below).

Let me know if you need additional information.

Kind regards,
Eva

Screenshot 2025-08-01 at 11.52.39.png
August 1, 2025 at 2:33 pm #17288756

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks.

To be able to investigate the problem, we need to replicate the issue on a clean installation.

I tried to replicate it myself, but I couldn't, I may be missing something. Can you help me with that?

I created a clean installation of WordPress, WooCommerce, WooCommerce Bookings, Mail Logging, WPML, and all necessary WPML add-ons.

You can access the WordPress dashboard using the link below:
hidden link

Kindly follow the steps below:

- Don't restore your site there.
- Try to replicate the issue with minimal steps.
- Then let me know the steps to see the problem and reproduce it.

Best Regards,
Otto

August 1, 2025 at 3:38 pm #17288948

Eva

Hi Otto,

thank you for the clean installation.

I created a bookable product in the same way I did on my website and I made a reservation request. As you see in Orders page you can find order #120 Jane Doe that I did from the websites's italian version.

In Wp Mail Logging there are 3 pending reservation mail (one for each language).
The user receives multiple emails....

Hope it helps
Eva

Screenshot 2025-08-01 at 17.31.26.png
Screenshot 2025-08-01 at 17.31.22.png
August 1, 2025 at 5:06 pm #17289143

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Thanks Eva!

I escalated the problem to our second tier support. I'll keep you posted.

Best Regards,
Otto

August 6, 2025 at 12:32 pm #17299453

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello Eva,

The problem should be fixed in WCML 5.5.2.

In the sandbox site I installed the beta version (5.5.2-b.1) and, as far as I can see, it's working as expected. Feel free to check it there, and let us know if something is still not OK.

Thanks!

Best Regards,
Otto

August 26, 2025 at 2:25 pm #17348725

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hi Eva,

WPML 4.8 and WCML 5.5.2 have just been released, the issue reported here should be fixed with the new versions.

Can you please give it a try?

❌ Please make a full website backup before proceeding ❌

Best Regards,
Otto

August 27, 2025 at 1:37 pm #17352100

Eva

Hi Otto,

with WooCommerce Bookings 2.2.9, WCML 5.5.2 and WPML 4.7.6 the issue appears to be fixed.
If I try to update to the latest version of WPML (4.8), the problem occurs again.

If I do not update to the latest version of WPML, the attached message appears.

Best Regards,
Eva

Screenshot WCML 5.5.2 and WPML 4.8.png
Screenshot WCML 5.5.2 and WPML 4.7.6.png
Screenshot message.png
August 27, 2025 at 6:41 pm #17352809

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Thanks, Eva. I am checking with our second tier support.
I'll get back to you soon.
Best Regards,
Otto

September 1, 2025 at 1:11 pm #17362687

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks for your patience.

We escalated the issue to our development team.

Meanwhile, as a workaround, you can install the mu-plugin that I am pasting at the end of this message. Please take into account that this is a temporary and not fully tested solution, so make sure to try it in a testing environment first and backup your site before using it.

Here's how to install mu-plugins:
hidden link

Best Regards,
Otto

<?php
/**
 * MU Plugin: Prevent duplicate "Booking Pending Confirmation" emails with WPML/WCML.
 *
 * When WCML duplicates `wc_booking` across languages, it sets `_booking_duplicate_of`.
 * For duplicated bookings, prevent sending the `booking_pending_confirmation` email.
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Disable any Bookings emails for WPML duplicated bookings (language clones).
 * Covers: customer (pending, confirmed, reminder, cancelled) and admin (new booking, admin cancelled).
 *
 * @param bool      $enabled Current enabled state.
 * @param mixed     $object  Email object (usually WC_Booking).
 * @param WC_Email  $email   Email instance.
 * @return bool
 */
function wcml_bookings_prevent_duplicate_emails_for_wpml_clones( $enabled, $object, $email ) {
	try {
		if ( ! $enabled ) {
			return $enabled;
		}

		// The filter provides $object (booking) and $email (WC_Email instance).
		$booking = null;
		if ( is_object( $object ) && ( is_callable( [ $object, 'get_id' ] ) || isset( $object->ID ) ) ) {
			$booking = $object;
		} elseif ( isset( $email->object ) ) {
			$booking = $email->object;
		}
		if ( ! $booking ) {
			return $enabled;
		}

		$booking_id = is_callable( [ $booking, 'get_id' ] ) ? (int) $booking->get_id() : (int) ( $booking->ID ?? 0 );
		if ( ! $booking_id ) {
			return $enabled;
		}

		// If it's a WCML duplicate, do not send this email.
		$duplicate_of = get_post_meta( $booking_id, '_booking_duplicate_of', true );
		if ( ! empty( $duplicate_of ) ) {
			return false;
		}
	} catch ( \Throwable $e ) {
		// Safe fallback: do not block the email on error.
		return $enabled;
	}

	return $enabled;
}

// Bookings email IDs (customer and admin) to cover all cases.
add_filter( 'woocommerce_email_enabled_booking_pending_confirmation', 'wcml_bookings_prevent_duplicate_emails_for_wpml_clones', PHP_INT_MAX, 3 );
add_filter( 'woocommerce_email_enabled_booking_confirmed', 'wcml_bookings_prevent_duplicate_emails_for_wpml_clones', PHP_INT_MAX, 3 );
add_filter( 'woocommerce_email_enabled_booking_cancelled', 'wcml_bookings_prevent_duplicate_emails_for_wpml_clones', PHP_INT_MAX, 3 );
add_filter( 'woocommerce_email_enabled_booking_reminder', 'wcml_bookings_prevent_duplicate_emails_for_wpml_clones', PHP_INT_MAX, 3 );
add_filter( 'woocommerce_email_enabled_admin_booking_cancelled', 'wcml_bookings_prevent_duplicate_emails_for_wpml_clones', PHP_INT_MAX, 3 );
add_filter( 'woocommerce_email_enabled_new_booking', 'wcml_bookings_prevent_duplicate_emails_for_wpml_clones', PHP_INT_MAX, 3 );