Skip to:
Content
Pages
Categories
Search
Top
Bottom

Send Private Message

  • I’m trying to send a private message when a new user signs up welcoming them to the site.

    I created a plugin but it’s not working so I’m suspecting messages_new_message isn’t right. Everything else was tested and works, except for messages_new_message.

    add_action( ‘user_register’, ‘welcome_user’ );

    function welcome_user($user_id) {
    global $wpdb;

    $recipients = ‘$user_id’;
    $subject = “Welcome to the site”;
    $content = “This is a test message.”;

    messages_new_message( array( ‘recipients’ => $recipients, ‘subject’ => $subject, ‘content’ => $content ));
    }

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Send Private Message’ is closed to new replies.
Skip to toolbar