sendSelfMessage( )

The sendSelfMessage API allows you to dynamically send message (one-way) from a particular user. This message will only appear in the senders chat box screen.


The $to is the user’s ID of the chat box and not the user to whom this message is being sent.


Sample Code

This API 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.");

This API is now deprecated in CometChat 5.4. This function should be replaced with sendMessage($to,$message,2);

Not finding what you need?

The CometChat team is here to help!