Creating link to new thread screen with prefilled username and message
<?php $user_id = 5; #Here you need to get user_id from somewhere depending on the environment $user = get_userdata($user_id); $nice_name = $user->user_nicename; $subject = urlencode('Have question about your product'); $message = urlencode('Have question about your product'); $link = BP_Better_Messages()->functions->get_link() . '?new-message&to=' . $nice_name . '&subject=' . $subject . '&message=' . $message; echo $link;
This code snippet is great example of how to create links to start new threads with other user in any place of your website.