Menu
Welcome
Quick start guide
Installing on your site
Connecting as operator
Operator commands
API
Operator settings
Roster variables and macroses

Sitehelp API - sendMessageToClient

API :: sendMessageToClient


Function allows to send message to client on behalf of operator
SITEHELP_API.sendMessageToClient(
	{
		message:  // message string
		notify_operator: // boolean, default is true, notify operator that he just send message to client :-)

		success:  // function will be called once message is successfully sent, with message as first parameter
		error: // function will be called on error, with error message as first parameter
	}
);


Example:

SITEHELP_API.onReady (SendMessageToClient);

function SendMessageToClient() {
	SITEHELP_API.sendMessageToClient(
		{
			message: 'this is test message sent to client chat',
			notify_operator: true,

			success: function (reply_message) {
				alert("My message is sent: " + reply_message);
			},
			error: function (error_msg) {
				alert("sendMessageToClientERROR:" + error_msg);
			}
		}
	);
};
Copyright 2011-2014 by Sitehelp.im.