• Resolved 319

    (@noyz319)


    Hi, love the plugin but how do I stop it from converting all <p> paragraph tags from the WordPress editor (visual or code editor) into double <br><br> tags in the actual email?

    It also injects unnecessary<br> tags after every list <li> tag making the list items all double spaced where they should not be and triple spaced after the end of all lists (ordered and unordered).

    This behavior is making all custom emails look inconsistent style wise in terms of spacing and margins since the email headers shown above the custom email content (i.e. We have finished processing your order, etc) all use paragraph tags.

    • This topic was modified 4 years, 1 month ago by 319.
    • This topic was modified 4 years, 1 month ago by 319.
    • This topic was modified 4 years, 1 month ago by 319.
Viewing 1 replies (of 1 total)
  • Plugin Author alexmustin

    (@alexmustin)

    Hi @noyz319,

    Thanks for using my plugin!

    I had added the extra line breaks so the default email content is visually separated from the Custom Email Message content.

    I see how this can cause issues, so in a future release I’ll create an option on the Settings page to disable the paragraph-to-br conversion.

    In the meantime, you can edit the plugin file /includes/class-woo-custom-emails-output.php — the code is repeated for each Message Status (“on-hold”, “processing”, “completed”) — example:

    
    if ( 'woocommerce_email_order_meta' === $this_email_template_location || 'woocommerce_email_customer_details' === $this_email_template_location ) {
    	// Extra line breaks at the beginning to separate Message content from Email content.
    	$output .= '<br><br>';
    }
    
    // Output the_content of the saved WCE Message ID.
    $output .= nl2br( get_post_field( 'post_content', $wcemessage_id_onhold ) );
    
    // Extra line breaks at the end to separate Message content from Email content.
    $output .= '<br><br>';
    

    You can remove those extra line breaks, and the nl2br() function so the line would be:

    $output .= get_post_field( 'post_content', $wcemessage_id_onhold );

    I hope this solves your issue for now.

    Thanks again for using my plugin!

    • This reply was modified 4 years, 1 month ago by alexmustin.
Viewing 1 replies (of 1 total)
  • The topic ‘How to stop plugin from converting paragraph tags to line breaks?’ is closed to new replies.