BuddyDev

Search

Issuing @mention notifications to all users with Admin role

  • Participant
    Level: Initiated
    Posts: 1
    Kieran Taylor on #3402

    So I have been thinking about moderation and reporting in BuddyPress and I am coming up pretty empty handed on what to do.

    I was thinking of something that would be super simple on the front end, creating a user with the username flag, users could then use the @mention feature to mention flag when they want an admin to look into something. But I would need to forward the notification(s) for the user flag to anyone who has the role admin or a set range of user ID’s (Say flag user ID is 99, Admin1 user ID is 88, and Admin 2 user ID is 77).

    Do you guys have any thoughts on this?

    Thank you in advance for reading this and any responses.

    Kind Regards,

    Kieran.

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

    Hi Kieran,
    Welcome to BuddyDev.

    What kind of notification you want the users to be notified. Do you want the email notification or the local site notification( Using BuddyPress notification).

    Here is some example code that will give you an start

    
    function buddydev_handle_custom_mention( $activity, $args1=null, $arg2=null,$arg3=null, $user_id = false ) {
    
    	//check if the $user_id is the specific user
    	
    	//if ye, Please use one of the strategies to notify users
    	//to find users, you may use get_users()
    	
    	
    
    }
    add_action( 'bp_activity_sent_mention_email', 'buddydev_handle_custom_mention', 10, 5 );
    
    

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 1
    Kieran Taylor on #3408

    Hi Brajesh,

    Thanks for getting back to me so soon, I was thinking the on-screen / local site notification. Thanks for giving me a starting point, I’ll definitely start looking into this, my skills with PHP are limited but I will see what I can hobble together.

    Thanks,

    Kieran.

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

    Hi Kieran,
    You are most welcome.

    If you plan local notifications, you will need to use bp_notifications_add_notification() to add new notification and please remember to register a dummy component to allow you format notifications for the users.

    Please do let me know how it went, I will be happy to assist.

    Thank you
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved