• Resolved kevinin2d

    (@kevinin2d)


    Hey!

    After updating Woocommerce e-mail template aligns right in e-mails sent after successful order(this occured in gmail and Outlook).

    After further investigation I noticed that email-header.php email template file has an table element like this inside of it

    <td><!-- Deliberately empty to support consistent sizing and layout across multiple email clients. --></td>
    
    

    After I made a custom template for email-header.php in my template and remove that element email returned back to center

    Anyone else experienced this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @kevinin2d

    Thanks for reaching out!

    I understand that after overriding the default email templates, the emails are now aligning to the right, correct?

    WooCommerce template files contain the markup and template structure for frontend and HTML emails of your store.

    When you open these files, you will notice they all contain hooks that allow you to add/move content without needing to edit template files themselves. This method protects against upgrade issues, as the template files can be left completely untouched.

    Kindly refer to this support documentation for your reference: Template structure & Overriding templates via a theme

    Hope this helps!

    I too have this problem. To re-iterate the problem is that by default the emails are right aligned using the default email-header.php template (see the below image)

    After overriding email-header.php template and removing the line:

    <td><!-- Deliberately empty to support consistent sizing and layout across multiple email clients. --></td>

    the emails are now centered as they should be:

    Tested in GMail and Outlook (the screenshots above are from GMail).

    WordPress: 6.1.1
    WooCommerce: 7.5.0

    Thanks

    Thread Starter kevinin2d

    (@kevinin2d)

    @xue28

    The issue of e-mail template aligning to the right happened before updating the template. After removing given code form the template the email aligned to the middle but on some e-mail software it is stretched out now.

    See @kilgoredude answer for more details. We have the same issue.

    Hi everyone,

    May I ask if you change your theme to the parent theme and then copy the email template file into the relevant folder in the parent theme, does that make a difference?

    Let us know how that goes.

    Hi,

    I’ve done some further testing and to cut a long story short this was (at least in my case) user error and you can consider my report closed. I’ll detail it below though in case it help anyone else.

    I had overridden email-footer.php to do some custom tweaks and missed the fact that after an update the default email-footer.php template had updated to also include the “<td><!– Deliberately empty….” line. Updating my template to the default and re-adding the customisations solved the issue.

    Had I paid attention to WooCommerce->Status->Templates->Overrides I would have seen the warning that:
    emails/email-footer.php version 3.7.0 is out of date. The core version is 7.4.0

    Thanks

    Hi @kilgoredude

    I’m glad updating the core version resolved your issue here. Thanks for sharing it with the community too! 🙂

    Meanwhile, if you have a few minutes, we’d love it if you could leave us a review:

    https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/

    Thanks!

    Thread Starter kevinin2d

    (@kevinin2d)

    Same thing with footer template for me. Issue solved

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘After update e-mail template aligns right’ is closed to new replies.