Created
August 3, 2014 19:42
-
-
Save DeskWOW/e179925743819a19ff7e to your computer and use it in GitHub Desktop.
Add this to the bottom of your "Chat Connected Screen" theme to automatically redirect users to your email form if they've waited over 3 minutes for an agent to accept their chat.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var timeout = 180000; | |
var redirectTo = "/customer/portal/emails/new"; | |
setTimeout('redirectToEmail()', timeout) | |
function redirectToEmail() | |
{ | |
if( "none" == $("#chat_send_area").css('display')) { | |
alert("We're sorry, but we are no longer available to chat at this time. To leave us a note, just fill out the contact form on the next screen."); | |
window.top.location.href = redirectTo; | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment