sendSelfMessage()
sendSelfMessage() allows you to dynamically send message (one-way) from a particular user. This message will only appear in the senders chat box screen.
The API
The $to is the user’s ID of the chat box and not the user to whom this message is being sent.
sendSelfMessage($to,$message);
Sample Code
This function is ideally used in plugins to inform the user of activity completion. The sender will only receive the same message.
include_once (cometchat/cometchat_init.php);
sendSelfMessage($toID,"has successfully sent Pizza request.");