Acquisition, Control, Communication: Engineering and Systems

olark('api.rules.defineRule', { id: 'delayed_response', description: 'Will send a response to the visitor after an operator doesn't respond.', condition: function(pass) { olark('api.visitor.getDetails', function(details) { var delay = 60 / details.messageCountForThisVisit; if (details.isConversing && details.secondsSinceLastMessageToOperator >= delay && !details.secondsSinceLastMessageToVisitor) { pass(); } }); }, action: function() { olark('api.chat.sendMessageToVisitor', { body: 'Sorry about the delay. We'll get back with you as soon as possible ... but it might be via e-mail, especially if it is currently 2am Pacific.' }); olark('api.chat.sendNotificationToOperator', { body: 'Automated delay message has been sent to visitor.' }); }, perVisitor: true });