Germanized ignoring WooCommerce’s Deferring Mails filter
-
Hi,
WooCommcerce added the functionality that emails are not send withing Checkout but after it. This boosts checkout (spinning wheel) time dramatically. This was added in 3.0.0 by default, but then because there’s too many bad hosters it was disabled by default in 3.0.3 (see https://github.com/woocommerce/woocommerce/pull/14344). Still if you have do not have a really bad hosters, then it works.
So we enabled it using the recommended way with this in our child theme:
add_filter( 'woocommerce_defer_transactional_emails', '__return_true' );
So mails should be deferred now. Turns out that Germanized ignores this and sends mails immediately during checkout nonetheless.
We found out about the issue because when using this filter it caused problems with emails not being translated when using Polylang for WooCommerce.
Here is what the maintainer of Polylang found out and after lots of communcation and debugging wrote back to me:
We could reproduce the issue ([meaning: Mails not being translated when using the ‘woocommerce_defer_transactional_emails’ filter]). After a long debug, we discovered that it’s due to WooCommerce Germanized bypassing some WooCommerce actions. I’ll try to explain what’s happening:
When you add the filter, WooCommerce doesn’t send the email immediately but queue it. However, for some reason, WooCommerce Germanized sends the email immediately. It does it by a direct call to the function used to send the email instead of firing the usual WooCommerce action on which WooCommerce hooks to end the email. Since the action is not fired, the Polylang for WooCommerce hook is inoperant and the translations are not done.
I suggest that you don’t try to defer the email as it is inefficient (since WooCommerce Germanized sends it immediately anyway) and this causes trouble in the translation.
So in the end I think it would be nice if the root cause of this, that is, Germanized ignoring the ‘woocommerce_defer_transactional_emails’ filter, could be fixed? As far as I understand WC still plans to default this to true by default again in some future, and even as it is now, it’s a quick way to boost checkout time, so it’s interesting to 90% of all sites.
PS I posted this in english, so I can forward the thread to the Polylang maintainer, in case he can give more information.
- The topic ‘Germanized ignoring WooCommerce’s Deferring Mails filter’ is closed to new replies.