Hey,
Every email in Woocommerce core uses two arguments when calling the header. Which plugin are you using that is not following the standards in woocommerce core? I can contact them and ask them to update their template.
Ben
Just to add, I do see your point for the sake of preventing fatal errors. It is good to fix templates as well.
Ben
Hi Ben, in this case it’s WooCommerce Bookings.
Also;
add_filter( 'woocommerce_mail_content', array( $this, 'add_gmail_hack' ), 50 );
should only be applied to HTML e-mail messages. Now we’ve got a shop which uses plain text and this results in plain text messages all starting with;
<style type="text/css">.gm-remove-late{ display:none;}</style>= Confirm booking =
I’m not surprised… Woocommerce bookings.
I’m pushing an update out with a fix for the gmail hack on plain emails.
Ben
Hi @britner
It seems like the fix for the ‘plain email gmail hack’ has disappeared?
The line <style type="text/css">.gm-remove-late{ display:none;}</style> is back in our plain WooCommerce emails.
I’ve looked into it and the exact reason why it has come back is unclear.
However I believe the 2 ‘gmail hack functions’ could be combined.
OLD:
public function check_to_add_gmail_hack( $css, $email = '' ) {
add_filter( 'woocommerce_mail_content', array( $this, 'add_gmail_hack' ), 50 );
return $css;
}
NEW:
public function check_to_add_gmail_hack( $css, $email = '' ) {
if( Kadence_Woomail_Customizer::opt('responsive_mode') != true ) {
$css .= '.gm-remove-late{display:none;}';
}
return $css;
}
Which makes function add_gmail_hack unnecessary and unused.
Because the woocommerce_email_styles filter only runs on HTML messages and, as far as I’ve seen, prepends inline CSS to woocommerce_mail_content filter.
It seems like the fix for the ‘plain email gmail hack’ has disappeared?
Nothing changed with that in the last update.
I don’t see it when I test with plain emails. Can you tell me more about your setup so I can recreate what you are seeing?
However I believe the 2 ‘gmail hack functions’ could be combined.
That isn’t how it works, The css has to be added late with a style tag, can’t be part of the inline css else it doesn’t work.
Ben
Hi Ben,
Why exactly do you think it cannot be combined?
I am assuming that @ remi123 tested it and it would work
– Klaas
That isn’t how it works, The css has to be added late with a style tag, can’t be part of the inline css else it doesn’t work.
Yeah OK, that makes sense.
Nothing changed with that in the last update.
I don’t see it when I test with plain emails. Can you tell me more about your setup so I can recreate what you are seeing?
Well.. since we’ve updated WooCommerce to it’s most recent version (3.9.0) it does work properly indeed.
So; problem solved.