Image in header for emails.
-
Hi,
I am not sure when this problem started occurring but I have had an <img> tag in the email header that has stopped working now. This was done in the email header input field within the processing email settings. For whatever reason now, in the email that is sent to customers it shows the full <img src=””…> tag text in the email instead of the image.
Do I have to edit this line in theme templates?
do_action( 'woocommerce_email_header', $email_heading, $email );Thanks.
-
Hello @seboaus,
By default, WooCommerce does not provide an option to add a logo to emails. If you are utilizing a plugin to modify the email template, I recommend reaching out to the plugin’s support team for further guidance. Additionally, your theme may be overriding the email templates, so I suggest checking in with the theme author as well.
Furthermore, if you have experience with PHP, then feel free to edit the template. You can also try adding a filter in yourfunctions.phpfile to modify that hook’s behaviour instead of dealing with the template files directly.
For example:add_filter( 'woocommerce_email_header', 'mm_email_header', 10, 2 ); function mm_email_header( $email_heading, $email ) { // do stuff }Hope this helps!
By default, WooCommerce does not provide an option to add a logo to emails.
I just wanted to clarify this part: you can add a global logo in the email settings, but it will be displayed on all WooCommerce emails, not just the “processing order” template.
You can find the email header option in WooCommerce > Settings > Email (scroll to the bottom).
Cheers!Hi @babylon1999,
Thank you for your reply.
If I could clarify further, I am using the Storefront theme and it does say that it is overriding my email templates but I do not touch those templates. We do not use a plugin for the email templates. The problem is within WooCommerce > Emails > Manage > Email Heading. This is where we have put our <img> tag which used to work up until recently. We have made no changes to our site.
Also, is there a way to change the global logo’s size? I am refraining from using that because the logo is just too big for the email.
Thanks.
I should also add that I have working HTML code in the “Additional Content” option as well: <table>, <a>, <p> tags included but no image for this one. Not sure why the HTML is working in that but not the Email Header option.
Hi @seboaus
Thanks for providing further information about your issue here.
If I could clarify further, I am using the Storefront theme and it does say that it is overriding my email templates but I do not touch those templates. We do not use a plugin for the email templates. The problem is within WooCommerce > Emails > Manage > Email Heading. This is where we have put our tag which used to work up until recently. We have made no changes to our site.
Can you please check if you can still access the URL of the header image that you are using? This might be the reason why the header image is not showing in your emails.

You can install the WP Mail Logging plugin to check the email logs. Then, please try to switch to the default Storefront theme and only WooCommerce and WP Mail Logging plugins are enabled, create a test order and check if the header is image is visible using the WP Mail Logging plugin.
If so, then this kind of problem is usually caused by your theme or a third-party plugin present on your site. We can run a conflict test to verify this. I’d recommend cloning your site to a staging environment and performing the tests described on this guide without modifying your live site or impacting customers. Many hosts provide staging facilities, so it’s worth checking in with them. It’s also possible to do it using the free WP Staging plugin.
If this was caused by a third-party plugin present on your site, it would be best to reach out to the developers for further assistance here.
If this did not resolve the issue, please share your System Status Report, that will help us further troubleshoot.
You can find it via
WooCommerce > Status. SelectGet system reportand thenCopy for support. Once you’ve done that, you can paste it into your reply here.If you could also provide the fatal error logs (if any) under
WooCommerce > Status > Logs.You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.
Also, is there a way to change the global logo’s size? I am refraining from using that because the logo is just too big for the email.
I’m afraid that there isn’t a built-in way to do this. You can check for an email customizer plugin that allows you change this setting, Kadence WooCommerce Email Designer is one option.
I should also add that I have working HTML code in the “Additional Content” option as well:
, , tags included but no image for this one. Not sure why the HTML is working in that but not the Email Header option.I replicated the scenario on my personal site running on the default Storefront theme, however, I am unable to reproduce the issue on my end. Here’s a sample text under
Additional contentfield.
And here’s the output as expected:

You could repeat the steps I mentioned above about the header image to check what is causing the conflict here why the HTML tags you added are not seen on the emails.
Hope this helps!
Hi @xue28,
Thank you for your reply.
Can you please check if you can still access the URL of the header image that you are using?
Yes this works fine. If I put the URL into the ‘header image’ option that you showed in your screenshot, the image shows in the email. But as I mentioned, I’m trying to put the image in the “Email Heading” option using an <img> tag, not the “header image” option.
We have not downloaded additional plugins and have not updated our theme for a while so I am unsure why it started occurring. We have a mail logging plugin set up and have traced the issue back to about a month and a half ago. It seems like the “Email Heading” option no longer accepts HTML input, and instead recognizes or escapes the HTML as normal text instead of HTML.
I will also try it on the staging site and get back to you.
Thanks.
Hi,
It did not work on the staging site.
Hello @seboaus,
Yes this works fine. If I put the URL into the ‘header image’ option that you showed in your screenshot, the image shows in the email. But as I mentioned, I’m trying to put the image in the “Email Heading” option using an <img> tag, not the “header image” option.
Thank you for clarifying!
The “Heading” field allows you to input text or choose from one of these placeholders by default:
Link to image: https://d.pr/i/AD6NnNThe “image header” is very close to where you want the image to be, however, if you position the image precisely in the “email heading”, I suggest following this guide on editing WooCommerce email templates: https://woocommerce.com/posts/how-to-customize-emails-in-woocommerce/
Cheers!
The topic ‘Image in header for emails.’ is closed to new replies.