BuddyDev

Search

Notify Admins

  • Participant
    Level: Initiated
    Posts: 5
    Mary Pearson on #1367

    Is there a way to add extra email addresses to Notify Admins? I would like my Moderators notified as well but don’t want to give them role of Admin.

    Thank you.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #1368

    Hi Mary,
    Welcome to BuddyDev forums.

    Thank you for asking the question. I have updated the plugin and version 1.0.1 is now available on WordPress.org plugin repo. It includes a filter that allows us to add any number of extra emails.

    Please upgrade to version 1.0.1 and then you can put following in your theme’s functions.php

    
    
    function bpp_notify_admin_extra_email_address( $emails, $context = null ) {
    	//$context will be 'topic'/'reply' if you need to do extra filtering
    	
    	$new_emails = array(
    		'a@example.com',
    		'b@example.com',
    		//keep adding
    	);
    	
    	return array_merge( $emails, $new_emails );
    }
    add_filter( 'bbp_notify_admin_email_addresses', 'bpp_notify_admin_extra_email_address', 10, 2 );
    
    

    Change the email address/add more as you need.
    Please note, there is no need to append admin email and it will be already included.

    Hope that helps. Please do let me know if it works for you or not?

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 5
    Mary Pearson on #1369

    Thank you. I upgraded to 1.0.1 and added the code to functions.php.

    I (Admin) am being notified as before, but I added two other emails that are mine to test the Mods and they are not receiving.

    This is the code I used:

    function bpp_notify_admin_extra_email_address( $emails, $context = null ) {
    //$context will be ‘topic’/’reply’ if you need to do extra filtering

    $new_emails = array(
    ‘mary@ChristianGays.com’,
    ‘mary@winningwebsitecreations.com’,
    //keep adding
    );

    return array_merge( $emails, $new_emails );
    }
    add_filter( ‘bbp_notify_admin_email_addresses’, ‘bpp_notify_admin_extra_email_address’, 10, 2 );

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #1370

    Did you try posting by your admin account? If yes, please try creating a topic/replying with normal user account(Super admins and current user are excluded).

    Also, since the other users are sent as bcc, please do check spam folders too.

  • Participant
    Level: Initiated
    Posts: 5
    Mary Pearson on #1371

    I tried as a subscriber four times, and the other users are also main accounts that I use, however I did check spam and they are not there.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #1372

    Hi Mary,
    I am sorry. It took me a little longer to figure out. There was a mistake on my part. There were two typos in my code. I was passing ‘header’ and expecting ‘headers’ causing the empty email list.

    You can see the change here.
    https://github.com/buddydev/bbp-notify-admins/commit/6fe27671a327bec2a2ef1f2a55ee9b901659ce65

    I have updated the plugin to version 1.0.2 with the fix.

    Please upgrade and now the above code will work.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 5
    Mary Pearson on #1377

    Wonderful! Thank you so much Brajesh! Now, do you think you could do the same thing for your WP Users Login plugin?

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #1378

    Hi Mary,
    Thank you for confirming.

    I will add in a day or 2 options in the wp login notifier plugin. We don’t have to use code to add emails as that plugin has options panel and I just need to extend that. Will keep you updated.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 5
    Mary Pearson on #1379

    Fabulous! Thank you so much!!!!

You must be logged in to reply to this topic.

This topic is: not resolved