Creating link to new thread screen with prefilled username and message

You are here:
< All Topics
<?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.

Next Custom messages location
Table of Contents