Skip to:
Content
Pages
Categories
Search
Top
Bottom

Auto send welcome message to new users


  • Kir 2012
    Participant

    @kir-2012

    Hi folks, I’m guessing I’m missing something really obvious here (it’s been a very long time since I worked, my apologies) – but I simply can’t seem to get this snippet working below when it was working perfectly before for me. Everything seems in order, but when I add a new user in admin and then login to that user acc to check, there’s no message. Can anyone spot my problem? Kind thanks for your input.

    //auto send msg
    function send_message_to_new_member( $user_id) {
        if ( !bp_is_active( 'messages' ) )
            return;
        $args = array(
            'sender_id' => 1,
            'thread_id' => false,
            'recipients' => $user_id,
            'subject' => 'Welcome to This Site!',
            'content' => 'Hello! Welcome to this blah blah' ,
            'date_sent' => bp_core_current_time()
        );
        $result = messages_new_message( $args );
    }
    add_action( 'bp_core_activated_user', 'send_message_to_new_member', 3 );
    //End Welcome PM//

    (I’m using all of the latest versions of wordpress, plugins etc etc)

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar