• Resolved Maz

    (@mouazzz)


    Hello There,

    I know this goes beyond and above the support this great plugin, however, I thought to bring this up to see if anyone has faced this problem.

    I have WP Better Emails + WooCommerce + Mandrill all working together. Emails sent out from WooCommerce products are missed up, the style sheets are broken.

    Emails sent out from wordpress itself, like new users registrations..etc are just fine. Apparently, WooCommerce does not work fine with WP Better Emails.

    I must also say that I tested WP Better Emails + EasyDigitalDownloads + Mandrill and things work fine. This is how I narrowed the issue up to WooCommerce-based generated emails.

    With WP Better Emails + WooCommerce + Mandrill:
    – If I disable WP better email (while the other two still active), things work fine; i.e. style sheets work fine.
    – If I disable Mandrill (while the other two still active), things also work fine.

    So obviously, once all of the three plugins are active, this mess occurs.

    So, if someone comes across a solution, please let me know, many thanks.

    https://wordpress.org/plugins/wp-better-emails/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Nicolas Lemoine

    (@nlemoine)

    Hi Maz,

    You should try this:
    http://justinsilver.com/technology/wordpress/using-wp-better-emails-woocommerce-email-templates/

    I haven’t tested but it may solve your problem.

    Thread Starter Maz

    (@mouazzz)

    Thanks Hellonico,

    Appreciate your prompt response. I will give it a try and see.

    Thanks again,

    Thread Starter Maz

    (@mouazzz)

    For whatever reason, this did not work 🙁

    I too am having an issue. If I disable wpMandrill, the emails look fine. The way I configured WooCommerce is to copy the WP Better Emails template code to the WooCommerce emaail_header.php and email_footer.php. It works fine. The problem come ins when I enable wpMadrill. I don’t think this is a WP Better Emails problem, rather a wpMadrill problem.

    A workaround is to change the email type in each of the WooCommerce emails to “Plain text”. It doesn’t look nearly as good but at least it is readable.

    I’ve been hacking at this all day as I need to get this working. It seems like the problem is between this plugin and wpMandrill so the issue may not be with wpMandrill.

    The order of events when you WooCommerce attempts to send an email.
    1. WooCommerce creates its payload (with template if applicable).
    2. WP Better Emails wraps the WC payload with its theme.
    3. wpMandrill sends the WP Better Emails message.

    To troubleshoot this issue, I wrote out (to the log) the payload right before Mandrill sends it (via the mandrill_payload filter). I see the WBP template code and it looks good. The problem is that the WC payload within has a bunch of “
    ” tags littered throughout it, within tags and completely invalidating the HTML that WC produced. It almost seems like a wierd version of wpautop was applied to it. Here’s an example.

    <p>An order has been created for you on Houston Psychological<br />
    Association. To pay for this order please use the following link: <a<br />
    href="http://stg.jawdropdesign.com/psychologyhouston.org/checkout/order-pay/591?pay_for_order=true&key=order_54db9a9d79e32"<br />
    style="color:#505050; font-weight:normal;<br />
    text-decoration:underline">pay</a></p><br />
    <br />
    <br />
    <br />
    <h2 style="color:#505050; display:block; font-family:Arial;<br />
    font-size:30px; font-weight:bold; margin-top:10px; margin-right:0;<br />
    margin-bottom:10px; margin-left:0; text-align:left;<br />
    line-height:150%">Order: #591 (<time<br />
    datetime="2015-02-11T12:07:00+00:00">February 11, 2015</time>)</h2><br />
    <br />

    You will see that most of the tags are split with these HTML breaks. Obviously, this will prevent the email from looking right. The very temporary fix is to, within the mandrill_payload filter, remove these. Note that this will also remove any intentional breaks. It’s a much better workaround than I posted above but I’d prefer a permanent fix.

    add_filter('mandrill_payload', 'my_mandrill_payload');
    function my_mandrill_payload( $message ) {
            $message['html'] = str_replace( "<br />", '', $message['html'] );
            return $message;
    }
    fedosky

    (@fedosky)

    This might be helpful. I found it while researching this problem.

    I tried it and it worked for me using WP Better Emails + WooCommerce + Mandrill.

    To completely remove the WooCommerce email headers and footers, leaving WP Better Emails to do them, add this to your theme’s functions.php file:

    //remove WooCommerce headers and footers

    function remove_woo_header_footer($object){
    remove_action(‘woocommerce_email_header’, array( $object, ’email_header’ ));
    remove_action(‘woocommerce_email_footer’, array( $object, ’email_footer’ ));
    }
    add_action( ‘woocommerce_email’, ‘remove_woo_header_footer’ );

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WP Better Emails WooCommerce Mandrill’ is closed to new replies.