Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.