Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: inbox to new user automatic from admin

@jennifersanchez

Participant

Hi! i tried but it isnt work.. i mean one message inside buddypress inbox like a user write to another.. is it?

function send_message_to_new_member( $user_id, $key, $user ) {

    if ( ! bp_is_active( 'messages' ) )
        return;
$recipients = array( $user_id );

    $args = array(
        'sender_id' => 1,
        'thread_id' => false,
        'recipients' => $recipients,
        'subject' => 'Hello new user',
        'content' => 'Welcome to the site',
        'date_sent' => bp_core_current_time()
    );

    $result = messages_new_message( $args );
}
add_action( 'bp_core_activated_user', 'send_message_to_new_member', 3 );
Skip to toolbar