E-mail template messed up
-
Hi all,
Since a couple weeks the e-mails that are sent to customers (order received and order shipped) are showing CSS code making the e-mail lay-out broken.
A dummy example: https://gyazo.com/0c376efbc1375441b026d53da2d979d8
The code that is showing:
< div id="wrapper" dir="ltr" style="background-color: #f7f7f7; margin: 0; padding: 70px 0; width: 100%; -webkit-text-size-adjust: none;">
And some bits in the bottom.It appears that there is a space between
<
anddiv
(first word) which might be messing up the whole layout.Is there a way for me to fix this in the files or by another method? I have tried using e-mail template plugins, but they have the same problem. I am not using any other plug-ins that interfere with the e-mails except a shipping tracking code plug in that I started using way after the e-mail layout broke.
Hope to have this fixed soon. Thanks.
The page I need help with: [log in to see the link]
-
Hey there!
Could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status.
Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.Yes, here you go, thanks.
After some searching by myself I came to the conclusion that it puts spaces in random places in the e-mail code. Today there was an order that placed spaces between letters in a surname and an adress (also in the same place as my first example). Really quite odd.I checked the woocommerce e-mail (header) code (I don’t let it override by my template) and that looked fine, no spaces in weird places.
The status report:
### WordPress Environment ### WordPress address (URL): https://thepack.cc Site address (URL): https://thepack.cc WC Version: 4.0.1 REST API Version: ? 1.0.7 WC Blocks Version: ? 2.5.14 Action Scheduler Version: ? 3.1.4 WC Admin Version: ? 1.0.3 Log Directory Writable: ? WP Version: 5.4 WP Multisite: – WP Memory Limit: 1 GB WP Debug Mode: – WP Cron: ? Language: en_GB External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.2.25 PHP Post Max Size: 50 MB PHP Time Limit: 600 PHP Max Input Vars: 5000 cURL Version: 7.62.0 OpenSSL/1.0.2k SUHOSIN Installed: – MySQL Version: 5.6.45 Max Upload Size: 50 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 4.0.1 WC Database Prefix: wp_ Total Database Size: 13.03MB Database Data Size: 10.58MB Database Index Size: 2.45MB wp_woocommerce_sessions: Data: 0.06MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 2.02MB + Index: 0.48MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.48MB + Index: 0.41MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 1.03MB + Index: 0.09MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 2.08MB + Index: 0.16MB + Engine InnoDB wp_postmeta: Data: 1.34MB + Index: 0.20MB + Engine InnoDB wp_posts: Data: 2.33MB + Index: 0.06MB + Engine InnoDB wp_shipment_batch_process: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.08MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woo_shippment_provider: Data: 0.06MB + Index: 0.00MB + Engine InnoDB wp_wpml_mails: Data: 0.14MB + Index: 0.00MB + Engine InnoDB wp_yoast_seo_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_seo_meta: Data: 0.16MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### attachment: 43 customize_changeset: 3 feedback: 10 nav_menu_item: 5 page: 13 polylang_mo: 2 post: 3 product: 3 revision: 153 shop_coupon: 32 shop_order: 64 shop_order_refund: 1 sp_wp_carousel: 1 wpcf7_contact_form: 1 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (16) ### Classic Editor: by WordPress Contributors – 1.5 Contact Form 7: by Takayuki Miyoshi – 5.1.7 Insert Headers and Footers: by WPBeginner – 1.4.5 Jetpack by WordPress.com: by Automattic – 8.4.1 Salient WPBakery Page Builder: by Michael M - WPBakery.com | Modified by ThemeNectar – 5.6 Under Construction: by WebFactory Ltd – 3.70 UpdraftPlus - Backup/Restore: by UpdraftPlus.Com DavidAnderson – 1.16.23 Advanced Shipment Tracking for WooCommerce: by zorem – 2.9.4 Checkout Field Editor for WooCommerce: by ThemeHigh – 1.4.2 WooCommerce Admin: by WooCommerce – 1.0.3 WooCommerce Stripe Gateway: by WooCommerce – 4.3.3 WooCommerce Services: by Automattic – 1.23.0 WooCommerce: by Automattic – 4.0.1 Yoast SEO: by Team Yoast – 13.4.1 WordPress Carousel: by ShapedPlugin – 2.1.9 – Not tested with the active version of WooCommerce WP Mail Logging: by MailPoet – 1.9.5 ### Inactive Plugins (4) ### Akismet Anti-Spam: by Automattic – 4.1.4 Facebook for WooCommerce: by Facebook – 1.10.2 Mailchimp for WooCommerce: by Mailchimp – 2.3.6 My Custom Functions: by Space X-Chimp – 4.42 ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: left Thousand Separator: . Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #235 - /catalogue/ Basket: #8 - /winkelmand/ Checkout: #9 - /checkout/ My account: #10 - /my-account/ Terms and conditions: #3 - /terms-and-conditions/ ### Theme ### Name: Salient Version: 10.0.1 Author URL: https://themeforest.net/user/themenectar Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? ### Templates ### Overrides: salient/woocommerce/checkout/form-checkout.php salient/woocommerce/checkout/review-order.php version 3.3.0 is out of date. The core version is 3.8.0 salient/woocommerce/checkout/terms.php salient/woocommerce/content-product.php version 3.4.0 is out of date. The core version is 3.6.0 salient/woocommerce/content-single-product.php version 3.4.0 is out of date. The core version is 3.6.0 salient/woocommerce/emails/customer-completed-order.php salient/woocommerce/loop/add-to-cart.php salient/woocommerce/loop/loop-start.php salient/woocommerce/myaccount/form-login.php version 3.5.0 is out of date. The core version is 3.6.0 salient/woocommerce/single-product/product-image.php salient/woocommerce/single-product/tabs/description.php salient/woocommerce/single-product/tabs/tabs.php version 2.4.0 is out of date. The core version is 3.8.0 Outdated Templates: ? Learn how to update ### Action Scheduler ### Complete: 1,495 Oldest: 2020-03-13 17:56:54 +0100 Newest: 2020-04-13 17:42:56 +0200 Pending: 2 Oldest: 2020-04-13 18:42:56 +0200 Newest: 2020-04-13 18:42:56 +0200
Thank you for that. This kind of problem is usually caused by either a conflict with your theme or with another plugin.
?
The best way to determine this is to:- Temporarily switch your theme to Storefront
- Disable all plugins except for WooCommerce
- Repeat the action that is causing the problem
If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict. You can find a more detailed explanation on how to do a conflict test here.
Hi,
My guess is that is a conflict with my theme. Don’t quite feel confident enough changing the current theme to something else, I’m afraid to lose my current config or mess something up.
Is it as easy as just activating the other (to test) and then changing back and have all my old settings be the same?
Yes, I am suspecting it may be a conflict with the theme as well – there are plugins like Health Check: https://www.ads-software.com/plugins/health-check/
Which allow you to disable plugins for just your session, but I am not sure if it applies to emails that are actually sent. Another option would be to create a staging site and test there instead.Hi,
I have found the fix. Apparantly it is a ”common” problem with woocommerce 4.0 and the combination with which host you have (?)
This code in function.php temporarily fixes it!
/** * Remove structure data output from emails. */ function wc_remove_structured_data_from_wc_email() { if ( WC()->structured_data instanceof WC_Structured_Data ) { remove_action( 'woocommerce_email_order_details', array( WC()->structured_data, 'output_email_structured_data' ), 30 ); remove_action( 'woocommerce_email_order_details', array( WC()->structured_data, 'generate_order_data' ), 20 ); } } add_action( 'woocommerce_init', 'wc_remove_structured_data_from_wc_email' );
What also might fix it is using a SMTP mailer plugin. Will look into that later.
Links: WordPress Forum & Github
I’m glad to hear you found the solution here, and thank you for posting what it was – that will be very helpful for anyone else who may have the same issue as you.
I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.
- The topic ‘E-mail template messed up’ is closed to new replies.