Support » Plugins and Hacks » [Resolved] ManDrill and Woocommerce

[Resolved] ManDrill and Woocommerce

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author MC_Will


    Yes it does!

    Here is the issue that we have. WordPress standard emails (password reset, etc.) are plain-text-ish with /n/r code. They look better when we check “Replace all line feeds (“\n”) by
    in the message body”

    Woocommerce sends nice HTML. They look worse when we check “Replace all line feeds (“\n”) by
    in the message body”

    What is your recommendation to address this either/or condition?

    Plugin Author MC_Will


    The best way will be to identify either WordPress or Woocommerce emails (tags will be your friends here) and then parse the body content in any way you want depending if they should have \n\r replaced or not.

    You should add this function to the mandrill_payload filter, obviously.

    I hope it helps,

    Do I need to add mandrill_payload in functions.php of child theme?

    Alright, I found some information in How-Tos section within of Settings => wpMandrill

    There is an example for “cart66 Lite Ecommerce plugin” given there. But I cannot understand how to implement it for WooCommerce. I’ve submitted a ticket to WooCommerce and also left a message at Mandrill. Hope one of them will gives an explanation on “Configuring WooCommerce and wpMandrill the right way!”

    I would like to hear from anyone of you, if you already did it.

    Plugin Author MC_Will


    Hello Chirag740,

    I’m not sure what do you need, exactly. WooCommerce works out of the box with wpMandrill. I just installed both plugins in a vanilla wp installation, added a WC product, purchased it and all emails I got where sent through Mandrill.

    In my Mandrill Dashboard I could see that the emails sent by this plugin are tagged as ‘wp_WC_Email->send’ so that’s the tag name you should use in your webhook function if you want to customize them.

    If you still have problems, I think it would be better to contact us directly so we can troubleshoot from there.

    Good luck!

    Thanks, MC_Will it works as you described “out of the box”.

    This should fix the problem

    function wd_mandrill_woo_order( $message ) {
        if ( in_array( 'wp_WC_Email->send', $message['tags']['automatic'] ) ) {
            $message['html'] = $message['html'];
        } else {
            $message['html'] = nl2br( $message['html'] );
        return $message;
    add_filter( 'mandrill_payload', 'wd_mandrill_woo_order' );
    Plugin Author MC_Will


    Hi Tareq,

    Just make sure the process inside that function really does what you need it to do with your message. That sample code is just, well, a basic sample.

    Something more useful would be, for instance, to change the Mandrill Template to use for WooCommerce emails.

    Although it’s a basic solution and it works for me.

    You get the WooCommerce order email as HTML in $message['html'], so I am not sure how you’ll handle using template.

    @tareq you mean to say this will apply to order emails (only)?

    Thanks Tareq,

    It seems to work, though only if you aren’t using a template. I guess the best situation then is to customise the WC templates individually rather than trying to use MailChimp / Mandrill templates.

    Then just save using templates for Mailchimp newsletters. Not the ideal set up but at least it works.

    Hopefully more implementation documentation and options will get created going forward, the plugin does still suggest it is in beta and I’m liking it so far.



    @mc_will thank you for this plugin!! Had it setup and running in 10 minutes! And now our emails from woocommerce ACTUALLY go to people’s inboxes. Amazing. Haha!

    Hello, if someone can please help me. WordPress standard emails are sent through Mandrill but Woocommerce email notificacion aren’t. Why is this happening?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Resolved] ManDrill and Woocommerce’ is closed to new replies.