The white space is applied via CSS. If you want to apply your own styles or want to modify the existing one in WooCommerce email notifications:
1) You can overwrite the template file:
- The template file can be overridden by copying it to
yourtheme/woocommerce/emails/email-styles.php
.
Replace line 50 - 56 @version 4.0.0
#wrapper {
background-color: <?php echo esc_attr( $bg ); ?>;
margin: 0;
padding: 70px 0;
-webkit-text-size-adjust: none !important;
width: 100%;
}
With
#wrapper {
background-color: <?php echo esc_attr( $bg ); ?>;
margin: 0;
padding: 70px 0;
padding-top: 0;
-webkit-text-size-adjust: none !important;
width: 100%;
}
Also see: Template structure & Overriding templates via a theme - How to Edit files
OR
2) Use the woocommerce_email_styles
filter hook:
// Add CSS to email
function filter_woocommerce_email_styles( $css, $email ) {
$extra_css = '#wrapper { padding-top: 0 }';
return $css . $extra_css;
}
add_filter( 'woocommerce_email_styles', 'filter_woocommerce_email_styles', 10, 2 );
Code goes in functions.php file of the active child theme (or active theme).
Optional: via $email->id == ...
you can target specific emails, see How to target other WooCommerce email notifications