• Resolved Gary Kealy

    (@ylkyrg)


    Hello,

    Nice plugin!

    I’m trying to change the email message through filters following the last example on this page: https://betternotificationsforwp.com/documentation/compatibility/useful-functions/

    Neither bnfw_notification_message nor bnfw_registration_email_message seem to be working.

    Currently I have this in functions.php but the registration message is just coming through as it’s setup in the admin:

    
    add_filter( 'bnfw_registration_email_message', 'bnfw_test', 10, 2 );
    function bnfw_test( $message, $setting ) {
    	$message = "<h1>Hello</h1>{$message}";
    
    	return $message;
    }
    

    Any help much appreciated.

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

    (@voltronik)

    Hi @ylkyrg,
    Thanks for your message.

    bnfw_notification_message should be the one you’re looking for.
    Have you set your priority equal to or higher than the one in the BNFW plugin?

    Thread Starter Gary Kealy

    (@ylkyrg)

    Thanks for getting back so quickly.

    Still not working I’m afraid. Here’s the updated code:

    
    add_filter( 'bnfw_notification_message', 'bnfw_test', 999, 2 );
    function bnfw_test( $message, $setting ) {
    	$message = "<h1>Hello</h1>{$message}";
    
    	return $message;
    }
    

    For further context, I’m testing this through the Send Me a Test Email button and the trigger is New User Registration - For User.

    • This reply was modified 4 years, 3 months ago by Gary Kealy.
    Thread Starter Gary Kealy

    (@ylkyrg)

    This does the trick:

    
    add_filter( 'bnfw_registration_email_message', 'test_email_message' );
    add_filter( 'bnfw_notification_message', 'test_email_message' );
    add_filter( 'bnfw_test_email_message', 'test_email_message' );
    
    function test_email_message( $message ) {
        $message = "<h1>Hello</h1>{$message}";
    
        return $message;
    }
    
    Plugin Author bnfw

    (@voltronik)

    Hi @ylkyrg,
    Great! Glad you got it working.

    If you like BNFW and the support, please feel free to leave an honest review.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filter email message’ is closed to new replies.