I would like to change the background color of the product thumbnails that the customer receives via WooCommerce email.
Is it possible to add a css to do this without modifying the original PNGs of the product photos? as a matter of design I would like to maintain the transparencies.
This is what I applied to my PHP to show the thumbnail:
add_filter( 'woocommerce_email_order_items_args', 'custom_email_order_items_args', 10, 1 );
function custom_email_order_items_args( $args ) {
$args['show_image'] = true;
}
2
Answers
I tried to insert the code inside my "function.PHP" file but unfortunately it still doesn't work. A doubt arises in my mind: the problem occurs on a Gmail test mailbox "I attach image", however when sending the email on WebMail (siteground) the background color of the images is white. Is there a way to resolve this conflict? This is a real inconvenience for me because some products in my shop have a completely black image.
You can use the following hooked function, to set thumbnail product backgound color to white:
Code goes in functions.php file of your child theme (or in a plugin). Tested and works.