Website Building » WooCommerce » How Do I Add a Logo to My WooCommerce Email?

How Do I Add a Logo to My WooCommerce Email?

Last updated on January 14, 2023 @ 8:18 am

Adding a logo to your WooCommerce email is easy! You can use the Customizer tool to upload your logo, and then simply add the following code to your email:

<img src="<?php echo esc_url( get_theme_mod( 'custom_logo' ) ); ?>"
alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"
width="<?php echo esc_attr( get_custom_logo()->width ); ?>"
height="<?php echo esc_attr( get_custom_logo()->height ); ?>" />
PRO TIP: If you are planning to add a logo to your WooCommerce email, be sure to take care of the following:

1. Make sure that your logo is in line with your brand identity.

2. Keep the size of your logo reasonable, so that it does not take up too much space in the email.

3. Avoid using a logo that is too small or too big.

4. Make sure that the logo is placed in a good position in the email.

If you want to align the logo to the left, center or right, you can add the align attribute before the end of the code above:

  • align="right"
  • align="center"
  • align="left"

By adding the align attribute and setting it to “left”, “center”, or “right” you can control the alignment of the logo within the email. The align attribute is not supported in HTML5, so it is advisable to use CSS to align images.

You can also use CSS to control other aspects of the logo’s appearance, such as its size, spacing, and border. And that’s it! With just a few lines of code, you can easily add a logo to your WooCommerce emails and customize its alignment and appearance to match your brand.

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.