• Resolved blegrand

    (@blegrand)


    Hi there !
    Because of the wpMandrill plugin i’m using to send my emails through Mandrill, mails sent via BNFW get double BR tags added to their content, and i’m looking for a way to remove them, is there a filter I could use to strip them out ?

    Thanks,
    Baptiste

    https://www.ads-software.com/plugins/bnfw/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author bnfw

    (@voltronik)

    Hi,
    Thanks for your message.

    Are you sending out your messages in HTML?
    If so, it’s likely that there’s a paragraph and then a <br> tag after it which is giving you double line breaks.

    Can you check this and report back?

    Thanks,
    Jack

    Thread Starter blegrand

    (@blegrand)

    Hi,
    yes it’s precisely the case.
    I found a solution, using a custom filter by the WPMandrill plugin : when the email sent is a BNFW notification, remove extra br from content.

    It fixed my problem, here’s the code I came up with to do so :

    function fix_duplicate_br($data)
    {
    	if(strpos($data['tags']['automatic'][0],"wp_BNFW_Engine") !== false)
    	{
    		$data['html'] = preg_replace( '/(<\/?br\ ?\/?>)/', ' ', $data['html'] );
    	}
    	return $data;
    }
    add_filter('mandrill_payload', 'fix_duplicate_br');

    Sorry it’s not entirely related to BNFW, but i suppose other users might have similar problems. Hope it’ll help !

    Plugin Author bnfw

    (@voltronik)

    No probs, blegrand!
    Glad you got it sorted ??

    Jack

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to remove double ?’ is closed to new replies.