.sendTextToChat()
(Last Updated On: April 10, 2015)
Overview

Send a message to the active Chat Agent without showing it to the Visitor. Optionally, add a second parameter of ‘visitor’ to send this message to the Visitor.

*Note: Requires an active chat (i.e. both the visitor and the agent have messaged eachother). For example, if you are using setCallback() to call sendTextToChat(), please use the ‘ChatMessageReceived’ event rather than the ‘StartChat’ event.


Returns
Type
Boolean
Values
true : there is an active chat and the message was sent to the Agent.
false : there is an active chat and the message was sent to the Visitor. Or, there is no active chat.

Parameters


text
Type
String | (Required)
Description
The text content of a message to be sent to the currently-active Chat Agent. When fired, the message will be sent to the Agent but not to the Visitor.
to
Type
String | (Optional)
Values
Use 'visitor'.
Description
Enter this optional parameter if you would like to send a message to the currently-active Visitor and not to the Agent.