Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Created August 3, 2014 19:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeskWOW/e179925743819a19ff7e to your computer and use it in GitHub Desktop.
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.
<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