maybe:
$args = array(
‘tokens’ => apply_filters(‘bp_better_messages_notification_tokens’, array(
‘messages.html’ => $messageHtml,
‘messages.raw’ => $messageRaw,
‘sender.name’ => $bm_user[‘name’],
‘thread.id’ => $thread_id,
‘thread.url’ => esc_url( Better_Messages()->functions->add_hash_arg( ‘conversation/’ . $thread_id, [], Better_Messages()->functions->get_link($user_id) ) ),
‘subject’ => $subject,
‘unsubscribe’ => esc_url(bp_email_get_unsubscribe_link(array(
‘user_id’ => $user_id,
‘notification_type’ => ‘messages-unread’,
))),
‘manual_unsubscribe’ => ‘
Per cancellare la tua sottoscrizione automatica agli avvisi per nuovi messaggi in chat, visita questo link.’
), $ud), // userdata object of receiver
$sender, // userdata object of sender
$thread_id
);