Skip to:
Content
Pages
Categories
Search
Top
Bottom

Message Multiple Users


  • synfrag
    Participant

    @synfrag

    My site has an account linking feature for couples, we would like to have messages sent from friends go to both couples as well as their partner. I’ve already got the functionality for linking and retrieving all the associated members. My question is, is it possible to hook into the message and add recipients? Where would be the best point to hook in?

    Any help would be great.
    Thanks!

Viewing 1 replies (of 1 total)

  • Slava Abakumov
    Moderator

    @slaffik

    Try something like this:

    function your_function($params){
    	/* here is the content of $params:
    	array(
    		'sender_id'  => bp_loggedin_user_id(),
    		'thread_id'  => false,   // False for a new message, thread id for a reply to a thread.
    		'recipients' => array(), // Can be an array of usernames, user_ids or mixed.
    		'subject'    => false,
    		'content'    => false,
    		'date_sent'  => bp_core_current_time(),
    		'error_type' => 'bool'
    	)
    	*/
    	$your_id = '123'; // get here all users ids that you need
    	array_push($params['recipients'], $your_id);
    	
    	return $params;
    }
    
    add_filter('bp_after_messages_new_message_parse_args', 'your_function');

    Not tested, though.

Viewing 1 replies (of 1 total)
  • The topic ‘Message Multiple Users’ is closed to new replies.
Skip to toolbar