UM custom email template css not applying
-
Hi developers,
I’ve a huge problem with UM and the email templates in the plugin. Because I’ve already an email template which works great I’ve tried to include it to UM which worked great in the first view. But now I’ve tried out some other email clients and notices that my external email css isn’t loading correctly for some clients. I’ve testet these clients with WooCommerce email sending and there all works fine but not in UM. Can you please help me?
<?php /** * Update email head */ add_filter( 'um_email_template_html_formatting', 'my_email_template_html', 10, 99 ); function my_email_template_html( $slug, $args ) { ob_start(); ?> <!DOCTYPE html> <html <?php language_attributes(); ?> style="height: 100%;"> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo( 'charset' ); ?>"/> <title><?php echo get_bloginfo( 'name', 'display' ); ?></title> <style type="text/css"><?php require get_home_path() . 'wp-content/themes/DiviChild/woocommerce/emails/style.css'; ?></style> </head> <?php $head = ob_get_clean(); return $head; } /** * Update email body */ add_filter( 'um_email_template_body_attrs', 'my_body_template', 10, 2 ); function my_body_template( $slug, $args ) { return 'style="margin: 0; height: 100%;" marginwidth="0" topmargin="0" marginheight="0" offset="0"'; }
This is the part where I set the body style and include my style.css in the head. The problem is that in some email clients the included css in UM has no effect. I did the same in WooCommerce and there’s all working expected.
Is there something wrong with my implementation / include for the css in UM?
- The topic ‘UM custom email template css not applying’ is closed to new replies.