Article

WHMCS client “email log” link modification

If you've been using WHMCS, I'm sure you know that it uses a pop-up window to display the email messages in the client email log page. This is an excellent feature for your clients to keep track of historical data and email correspondence. There is, however, one small issue with the presentation.

I've always been anti pop-up for several obvious reasons:

  1. Calling multiple windows on the same website is annoying.
  2. You don't want to give your customers the option of unblocking pop-up windows because it can be an inconvenience and could possibly lead to confusion on their end. No, I will not give them the benefit of doubt...
  3. Pop-up windows are often blocked by today's modern web browsers, and the "safe list" management can be annoying.
  4. Pop-up windows are so 1999! Get with the times!

The moral? Annoyance. Given the fact that most web visitors have an extremely short attention span, I came up with an elegant solution using Lytbox to work around this. This work around requires three small modifications to your WHMCS template files. Here is how you do it (copy & paste):

  1. Make a backup copy of header.tpl and clientareaemails.tpl before you make any changes. This is where source safe is extremely useful!
  2. Download the Lytbox bits, save them to your WHMCS template directory (or any other location).
  3. Edit header.tpl and add the following lines to the source before </head>:<script type="text/javascript" src="[path]/lytebox.js"></script>
    <link rel="stylesheet" href="[path]/lytebox.css" type="text/css" media="screen" />
  4. Edit clientareaemails.tpl and look for "{$email.subject}". Replace the {$email.subject} hyperlink  with the following:<a href="viewemail.php?id={$email.id}" rel="lyteframe" title="{$email.subject}"
    rev="width: 650px; height: 450px; scrolling: yes;">{$email.subject}</a>
  5. You can adjust the windows width and height in the hyperlink above.
  6. Save both files, then upload them to your server. At this point, you should be able to test it out by visiting a client's dashboard. The result  should look something like the image below.

Now you have an fancy presentation window. Enjoy!

3 Responses to “WHMCS client “email log” link modification”

  1. Scott
    April 12, 2010 at 8:40 pm #

    Sweet hack !!

    Were you able to get this to work in the admin clientssummary.tpl ?

    It starts to open but then I get a new admin window which closes right away.

    • Will
      April 12, 2010 at 8:53 pm #

      Hmm… I haven’t ran into that issue but, I haven’t tried anything other than modifying the template.

  2. Scott
    April 14, 2010 at 2:34 pm #

    odd

Leave a Reply