Sales and support monitoring tool for WHMCS

A growing sales and support requirement inevitably leads to more hands on keyboards which is also the most expensive side of technology, so anything that can help better utilise the human resources already available can be a godsend.

whmcs monitoring tool WHMCS Support Monitoring System Tray Application

WHMCS support module has matured to something very usable, with two caveats.  First it seems a shame the authors have not heeded the calls for the ability to send rich media replies and thus incorporate videos and images in predefined replies.  Their excuse that you can send a link to those if you wish is nothing short of lame, even worse they site “security issues” as the reason when the real reason is surely they just cannot be bothered (after all, if they have customers that agree with them, how difficult would it be to supply the solution as an option).

But I’m not here to rip them a new one, their latest release is truly fantastic and better than any other host billing system I have used, it makes Modern Billing look tedious and infezible (which indeed it is).  Utilising their API and the includes/hooks folder enables unlimited customisation, indeed I have bent it to supplying electronic products and license management with great results.

The second caveat is the lack of an alert system.  Up until recently I used a very old Kayako support system but the balance of power is back in WHMCS court except that Kayako had a simple “flashing beeping” thingy that would notify you when a new ticket or customer reply had been received.  It was a basic product and rather featureless yet it did an important job and as I missed it so much decided to write one for WHMCS.

download WHMCS Support Monitoring System Tray Application

Ticket Review (setup.msi) Windows Setup MSI, download and double click.

Ticket Review (manual) Zip file contains program EXE, a php file and readme.txt with instructions for manual installation.

Installation Instructions

Ticket Review monitors up to two support departments in WHMCS and alerts you of a new ticket by changing the color of the system tray icon and optionally playing a wav file too.  Ticket Review can be used by an unlimited number of sales and support staff.

1.  Unzip and place files in a directory.
2.  Upload ticketreview.php to your WHMCS install direcory on your host webserver.

Configuration

To configure your application double click the Ticket Review.exe  When you first run the application you need to complete some of the fields.  The Tickets Link is the URL to your WHMCS and will look something like this:-

http://yourdomain.com/client/ticketreview.php

If you only have one support ticket department you need only complete the Red Department Id.  We operate two departments and allocate the Red to Sales and the Green to Support.

How to find the Department Id

Login to WHMCS as admin, the select Support Departments from the Setup dropdown.  Hover your mouse over the edit icon and a link is displayed in the status bar, at the end of the link there is &id= the number following this is your department id.

How to add sound

Sometimes it is useful to add sound, if you don’t want it just leave the WAV fields blank.  Google for fancy wavs to produce bings or bongs or whatever takes your fancy, I prefer to hear a voice telling me whether a sales or support ticket is in and use ATT’s Text to Speech demo tool to create a WAV which can be found here:-

http://www2.research.att.com/~ttsweb/tts/demo.php

What next?

After setup you should create a couple of test tickets to make sure it all works.  If it doesn’t check the link to the PHP file is correct and try running it directly in your browser to make sure there are no errors.

What is supposed to happen?

When a new sales or support ticket arrives the icon will begin to flash.  If you have added a wav that will be played each time the application checks and finds a ticket that needs your attention.  This will probably get a little annoying after a while so you can delay the check by 5 minutes by double clicking the system tray icon (which will also stop flashing).  The idea is this application will bug you until you answer your ticket!  But you can delay that nuisance for 5 minutes as often as you like!

Support

This is a simple application and shouldn’t really need support.  You can probably think of hundreds of ways in which to improve the application and while I do not wish to steal your thunder I have probably thought of them too, this application is intended to just alert you of new tickets, stats and integrating with facetwitter are all cool ideas but they don’t really improve it.  However if you need a contractor to write additional features then please contact me at mwdev@ventrino.com or call UK +447850018933 and ask for Martyn

 

Internal Coding Guidelines

An abridged version of Brad Abrams coding guidelines courtesy of Nigel Belham with minor layout modifications for increased clarity.

Introduction

First, read the .NET Framework Design Guidelines. Almost all naming conventions, casing rules, etc., are spelled out in this document. Unlike the Design Guidelines document, you should treat this document as a set of suggested guidelines. These generally do not affect the customer view so they are not required.

Style Guidelines

Tabs & Indenting

Tab characters (\0×09) should not be used in C# code files. All indentation should be done with 4 space characters.

Bracing

Open braces should always be at the beginning of the line after the statement that begins the block. Contents of the brace should be indented by 4 spaces. For example:

if (someExpression)
{
   DoSomething();
}
else
{
   DoSomethingElse();
}

“case” statements should be indented from the switch statement like this:

switch (someExpression)
{
 
   case 0:
      DoSomething();
      break;
 
   case 1:
      DoSomethingElse();
      break;
 
   case 2:
      {
         int n = 1;
         DoAnotherThing(n);
      }
      break;
}

Braces should never be considered optional. Even for single statement blocks, you should always use braces. This increases code readability and maintainability.

for (int i=0; i<100; i++) { DoSomething(i); }

Single line statements

Single line statements can have braces that begin and end on the same line.

public class Foo
{
   int bar;
 
   public int Bar
   {
      get { return bar; }
      set { bar = value; }
   }
 
}

It is suggested that all control structures (if, while, for, etc.) use braces, but it is not required.

Commenting

Comments should be used to describe intention, algorithmic overview, and/or logical flow. It would be ideal, if from reading the comments alone, someone other than the author could understand a function’s intended behaviour and general operation. While there are no minimum comment requirements and certainly some very small routines need no commenting at all, it is hoped that most routines will have comments reflecting the programmer’s intent and approach.

Copyright notice

Each file should start with a copyright notice. To avoid errors in doc comment builds, you don’t want to use triple-slash doc comments, but using XML makes the comments easy to replace in the future. Final text will vary by product (you should contact legal for the exact text), but should be similar to:

//---------------------------------------------------------------
//
//     Copyright (c) Microsoft Corporation.  All rights reserved.
//
//---------------------------------------------------------------

Documentation Comments

All methods should use XML doc comments. For internal dev comments, the <devdoc> tag should be used.

public class Foo
{
 
/// Public stuff about the method
///
What a neat parameter!
/// Cool internal stuff!
///
public void MyMethod(int bar) {}
 
}

However, it is common that you would want to move the XML documentation to an external file – for that, use the <include> tag.

public class Foo
{
 
   ///
   ///
   public void MyMethod(int bar) {}
 
}

Comment Style

The // (two slashes) style of comment tags should be used in most situations. Where ever possible, place comments above the code instead of beside it. Here are some examples:

public class SomethingUseful
{
    private int          itemHash;            // instance member
    private static bool  hasDoneSomething;    // static member
}

Spacing

Spaces improve readability by decreasing code density. Here are some guidelines for the use of space characters within code:

  • Do use a single space after a comma between function arguments.
    Right: Console.In.Read(myChar, 0, 1);
    Wrong: Console.In.Read(myChar,0,1);
  • Do not use a space after the parenthesis and function arguments
    Right: CreateFoo(myChar, 0, 1)
    Wrong: CreateFoo( myChar, 0, 1 )
  • Do not use spaces between a function name and parenthesis.
    Right: CreateFoo()
    Wrong: CreateFoo ()
  • Do not use spaces inside brackets.
    Right: x = dataArray[index];
    Wrong: x = dataArray[ index ];
  • Do use a single space before flow control statements
    Right: while (x == y)
    Wrong: while(x==y)
  • Do use a single space before and after comparison operators
    Right: if (x == y)
    Wrong: if (x==y)

Naming

Follow all .NET Framework Design Guidelines for both internal and external members. Highlights of these include:

  • Do not use Hungarian notation
  • Do not use a prefix for member variables (_, m_, s_, etc.). If you want to distinguish between local and member variables you should use “this.” in C# and “Me.” in VB.NET.
  • Do use camelCasing for member variables
  • Do use camelCasing for parameters
  • Do use camelCasing for local variables
  • Do use PascalCasing for function, property, event, and class names
  • Do prefix interfaces names with “I”
  • Do not prefix enums, classes, or delegates with any letter

The reasons to extend the public rules (no Hungarian, no prefix for member variables, etc.) is to produce a consistent source code appearance. In addition a goal is to have clean readable source. Code legibility should be a primary goal.

Naming Conventions

Interop Classes

Classes that are there for interop wrappers (DllImport statements) should follow the naming convention below:

  • NativeMethods – No suppress unmanaged code attribute, these are methods that can be used anywhere because a stack walk will be performed.
  • UnsafeNativeMethods – Has suppress unmanaged code attribute. These methods are potentially dangerous and any caller of these methods must do a full security review to ensure that the usage is safe and protected as no stack walk will be performed.
  • SafeNativeMethods – Has suppress unmanaged code attribute. These methods are safe and can be used fairly safely and the caller isn’t needed to do full security reviews even though no stack walk will be performed.
class NativeMethods
{
   private NativeMethods() {}
 
   [DllImport(“user32”)]
   internal static extern void FormatHardDrive(string driveName);
}
 
[SuppressUnmanagedCode]
class UnsafeNativeMethods
{
   private UnsafeNativeMethods() {}
 
   [DllImport(“user32”)]
   internal static extern void CreateFile(string fileName);
}
 
[SuppressUnmanagedCode]
class SafeNativeMethods
{
   private SafeNativeMethods() {}
 
   [DllImport(“user32”)]
   internal static extern void MessageBox(string text);
}

All interop classes must be private, and all methods must be internal. In addition a private constructor should be provided to prevent instantiation.

File Organization

  • Source files should contain only one public type, although multiple internal classes are allowed
  • Source files should be given the name of the public class in the file
  • Directory names should follow the namespace for the class

For example, I would expect to find the public class “System.Windows.Forms.Control” in “System\Windows\Forms\Control.cs”…

  • Classes member should be alphabetized, and grouped into sections (Fields, Constructors, Properties, Events, Methods, Private interface implementations, Nested types)
  • Using statements should be inside the namespace declaration.
namespace MyNamespace
{
 
using System;
 
public class MyClass : IFoo
{
 
      // fields
      int foo;
 
      // constructors
      public MyClass() {}
 
      // properties
      public int Foo { get {} set {} }
 
      // events
      public event EventHandler FooChanged { add {} remove {} }
 
      // methods
      void DoSomething() {}
      void FindSomethind() {}
 
//private interface implementations
   void IFoo.DoSomething() { DoSomething(); }
 
// nested types
   class NestedType {}
 
}
 
}
 

Ever need to send a one-line email from a DOS/CMD batch file? If your PC or Server has .Net 2 installed you can use this application.

It’s straightforward. Place the cmdSendmail.exe in your path or working directory and then type something like this at the command line:-

cmdSendMail you@emailtest.com~you@somewherelse.com~The Subject~The main text of the message~you@somewherelse.com~pass123~mail.somewherelse.com

Usage

cmdSemdMail {command string delimited by tilde}

To send an email create a single string with all the paramters of your message. Use the tilde (~) to delimit the paramters of your email.

cmdSendMail Download

© 2011 Martyn Walker | Software Architect | Hiker And Hacker Suffusion theme by Sayontan Sinha