Emails sent from WooCommerce in Hebrew arrive with question marks
-
When email is sent from WooCommerce, and the locale is set to he_IL, emails arrive with question marks instead of any Hebrew character.
Using WordPress 4.3.2 with WooCommerce 2.4.12 on Debian 8 with PHP 5.6.15. Email is sent via SMTP using Easy WP SMTP.
I’ve traced the problem to the use of Emogrifier by the WooCommerce
class-wc-email.php
file, and it looks to be the PHP DomDocument implementation that goes crazy when UTF-8 encoded HTML is submitted toDOMDocument::loadHTML
when it contains HTML meta tags with encoding specification.There are several documented workarounds and it looks like the latest version of Emogirifier (from https://github.com/jjriv/emogrifier ) implements the required workarounds. I’ve dropped in the latest version instead of the one currently in WooCommerce – without any changes except that I had to remove the namespace decleration – and it worked out of the box and solved the problem.
- The topic ‘Emails sent from WooCommerce in Hebrew arrive with question marks’ is closed to new replies.