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

Sitehelp API - sendMessageToOperator

API :: sendMessageToOperator


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

		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 (SendMessageToOperator);

function SendMessageToOperator() {
	SITEHELP_API.sendMessageToOperator(
		{
			message: 'this is test message sent to operator',
			notify_client: true,

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