Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Matt Miller

    (@millermedianow)

    Hi @someka , are you experiencing line break issues on all emails or does it only seem to be happening with WooCOmmerce product reviews?

    Have you tried enabling the option in our plugin that is titled:
    ‘Replace all line feeds (“\n”) by <br/> in the message body”
    ?

    Thread Starter someka

    (@someka)

    Hi there,

    Yes I have enabled them but then it changes every email (even the HTML ones) and break them significantly. I only want to apply this specific to review notifications. (as it is a default wp text-only email)

    How to apply that only for certain emails (comment notifications in this case)?

    Joel Black

    (@blackbeardesign)

    Same problem for me. Woocommerce emails are blown up. If I uncheck the box, they look correct, but then other non-Woocommerce emails lose all the line breaks and become one long sentence.

    Plugin Author Matt Miller

    (@millermedianow)

    Hi @someka and @blackbeardesign , we were just able to recreate this internally here and are working on a fix now. Will let you know as soon as we have an update!

    Plugin Author Matt Miller

    (@millermedianow)

    This appears to be the result of WooCommerce adding additional HTML comments in the templates for their emails. They added them on new lines in the code so when the templates are rendering, it interprets them as a ‘new line’ character and Mandrill replaces them with HTML line breaks.

    Working up a solution now!

    Thread Starter someka

    (@someka)

    Hey @millermedianow ,

    Until you bring up a working solution, can you give us a code to exclude Woocommerce from that <br> setting?

    So that we enable this setting:
    “Replace all line feeds (“\n”) by <br/> in the message body”

    and won’t apply to Woocommerce. (as this works good for all other emails)

    Plugin Author Matt Miller

    (@millermedianow)

    Hi @someka ,
    This is a good idea. We are getting close to a solution, this is a oddly tricky one to resolve. Should have something ready here shortly, testing our code updates right now.

    Plugin Author Matt Miller

    (@millermedianow)

    Hi @someka and @blackbeardesign ,
    You can add the code below to your theme’s functions.php file and this should resolve the issue.

    We are integrating this type of solution into the plugin as the WooCommerce emails do not need to utilize this setting in the plugin due to the recent changes.

    Let us know if this works for you. Thanks!

    add_action( 'woocommerce_email', function() {
    	add_filter( 'mandrill_nl2br', '__return_false' );
    }, 10, 1 );
    Plugin Author Matt Miller

    (@millermedianow)

    Hi @someka ,
    We have updated the plugin to include another option to toggle a fix for the WooCommerce emails. Please update and let us know if that works. Thanks!

    https://www.ads-software.com/plugins/send-emails-with-mandrill/

    Thread Starter someka

    (@someka)

    Thank you @millermedianow,

    I will try and inform as soon as possible.

    Thread Starter someka

    (@someka)

    Hi again @millermedianow ,

    Unfortunately, it is even worse now.
    Prepared an SS for you:

    Actually, I use “pre” tag for contact emails and it works ok for now. (until you guys find a nice solution for this..)

    • This reply was modified 3 years, 8 months ago by someka. Reason: formatting
    • This reply was modified 3 years, 8 months ago by someka.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Change Line Feeds for all WordPress Emails’ is closed to new replies.