deathrequest Posted November 22, 2011 Share Posted November 22, 2011 More than often, I hate waiting for the POP Import to be done on my tickets before I can reply to a client. At those moments, I wished if somehow the import from POP could be done right now, so that I can see the new ticket/reply in my WHMCS. So, every time this happens I manually call my POP Import script. To resolve this issue, I created this little javascript snippet which basically checks the POP Import every time a request for the Support Tickets page is made in the Admin Area. So, with this snippet, you will be sure that the tickets you are seeing in the Support Tickets area are the latest replies or the latest new tickets and that there is no lag between the Support Tickets in WHMCS and the actual emails by clients. You will not have to wait 4-5 minutes to see if there are any new tickets or replies that might be imported. Add the following snippet in your header.php of the admin area template you are using (e.g. /admin/templates/v4/header.php), just before the closing head tag (</HEAD>) <script type="text/javascript"> $(document).ready(function() {ldelim} var pageurl = "{$smarty.server.PHP_SELF}"; var newmails = 0; page = pageurl.split("/"); page = page[page.length - 1]; if (page == "supporttickets.php") {ldelim} $.get('../pipe/pop.php', function(data){ldelim} $.each(data.match(/<br>Email Count: (.*?)<hr>/g), function(i, m) {ldelim} newmails = newmails + parseInt(m.match(/\d/)); {rdelim}) if (newmails) window.location = pageurl; {rdelim}); {rdelim} {rdelim}); </script> Regards Nikhil Gupta, Wicked Developers 0 Quote Link to comment Share on other sites More sharing options...
jasonhk Posted November 26, 2011 Share Posted November 26, 2011 Why don't you use email piping rather? This way any replies will be parses in real-time into WHMCS. http://docs.whmcs.com/Email_Piping 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.