HELP FILE

How to Notify Customers of New Message from Technician (Blinking)

You can notify your customers of a new incoming Instant Chat (IC) message by making the IC tab blink, or by other custom notification method.

Customize the following code and insert it into your environment.

ICLoader.PostMessageTargetOrigin = null; //https://[YourSite].com<:443>
Important: The domain name and port number (when using a custom port) are mandatory; empty strings and asterisk are not allowed.
function receiveICMessage(event) {
    if (event.origin !== "https://secure.logmeinrescue.com") { //please ALWAYS validate that the message is coming from a Rescue Website!
        return;
    }

    if (event.data && event.data.event === "IcChatMessage") {
        /*
         This event will send a notification every time a new IC message is received. 
         Remember that you need to set the ICLoader.PostMessageTargetOrigin property with the valid domain of your self hosted site.
         You can use this, for example, to notify your customers of new messages (blinking the chat tab or other custom notification solutions), 
	or implement your custom IC chat monitioring
         (Tip: The Rescue Command  Center has an Applet & IC Chat Monitoring feature.)
       */

        if (event.data.source === "tc") {
            //chat message has been received from the Technician Console; you can implement IC blinking, or custom Push Notification to notify 
		your end-user (IC user)
        }
        else if (event.data.source === "client") {
            //add custom code here for messages sent by the client
        }
    }
}

window.addEventListener("message", receiveICMessage, false);