Cómo notificar a los clientes un nuevo mensaje del técnico (parpadeo)
Los artículos relacionados con la personalización están redactados para una audiencia técnica con experiencia en el desarrollo web. Se requieren conocimientos de HTML, CSS y JavaScript.
Puede notificar a sus clientes la llegada de un nuevo mensaje de Chat Instantáneo (IC) haciendo que la pestaña IC parpadee, o mediante otro método de notificación personalizado.
Personaliza el siguiente código e insértalo en tu entorno.
ICLoader.PostMessageTargetOrigin = null; //https://[YourSite].com<:443>
Importante: El nombre de dominio y el número de puerto (cuando se utiliza un puerto personalizado) son obligatorios; no se permiten cadenas vacías ni asteriscos.
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);
Article last updated: 27 September, 2022