• Resolved consultr

    (@consultr)


    Hi! We deactivated WP Better Emails because it was causing vulnerability issues and replaced it with WP HTML Mail – Email Template Designer. Order Confirmation emails are working fine in staging, but in production, they don’t have the style assigned.

    WP Better Emails had this code that was commented on:

    add_action( 'phpmailer_init', 'better_phpmailer_init', 20 );
    function better_phpmailer_init( $phpmailer ){
    	// this filter will return true if the woocommerce_email_header action has run
    	if ( apply_filters( 'better_wc_email', false ) ){
    		global $wp_better_emails;
     
    		// Add template to message
    		$phpmailer->Body = $wp_better_emails->set_email_template( $phpmailer->Body );
     
    		// Replace variables in email
    		$phpmailer->Body = apply_filters( 'wpbe_html_body', $wp_better_emails->template_vars_replacement( $phpmailer->Body ) );
    	}
    }

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hello @consultr
    It seems you are using a different way to send your emails in staging and production. This could be the reason the code above was necessary in production.
    What kind of email delivery do you use? (SMTP / Mailgun / …)
    Most delivery services should work with Post SMTP without any additional code.

    best regards, Hannes

Viewing 1 replies (of 1 total)
  • The topic ‘Styles not working in production’ is closed to new replies.