BuddyDev

Search

[Resolved] Auto Welcome PM

  • Participant
    Level: Enlightened
    Posts: 118
    Erich199 on #2149

    Is it possible to have an auto welcome private message sent when the user confirms their email on the website?

    I know there was a plugin a long time ago that did this, but I don’t think it’s been supported for a few years now.

  • Keymaster
    (BuddyDev Team)
    Posts: 24577
    Brajesh Singh on #2153

    Hi Joshua,
    Thank you for asking.

    Do you want me to put the code or a plugin? It is very easy to achieve.

  • Participant
    Level: Enlightened
    Posts: 118
    Erich199 on #2157

    Hi Brajesh,

    I managed to get it figured out.

    //Welcome PM//
    
    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 Art of War Gaming!',
            'content' => 'Welcome! message here',
            'date_sent' => bp_core_current_time()
        );
    
        $result = messages_new_message( $args );
    }
    add_action( 'bp_core_activated_user', 'send_message_to_new_member', 1 );
    //End Welcome PM//
  • Keymaster
    (BuddyDev Team)
    Posts: 24577
    Brajesh Singh on #2175

    Thank you Joshua.
    Appreciate you posting the code. It might be useful for others.

The topic ‘ [Resolved] Auto Welcome PM’ is closed to new replies.

This topic is: resolved