Jump to content

SMS Intergration to WHMCS


chisel

Recommended Posts

1 - SMS Notification Integration

 

We would like to be alerted via SMS when a high priority support request or a new order comes through, we have the Click-a-tell PHP API but not sure if this sort of integration is available?

 

To add another level of complexity we would only like it to do this during certain hours of the day (which I can do with PHP, as long as I can stick the PHP in somewhere?)

 

 

 

2 - Billing for SMS (that customers use)

 

Some of our customers have us send SMS' under various conditions. Currently I have a database which stores the customer name and the time/date of the SMS, so at the end of the month I bill the customers for those messages.

 

Is there a way to do this within WHMCS? I thought using a custom field on the client record to store the number of messages sent, but then is there a way to automatically bill based on this?

Link to comment
Share on other sites

1 -- If you're needing something this custom, you should be able to write your own script based off the database directly to do these functions, although it would require a good amount of work.

 

2 -- Couldn't you just manually create an invoice each month for the SMS messages?

Link to comment
Share on other sites

1- ok cool, i will have to do something with cron, checking as orders/support requestes come in. i thought maybe i could embed into a script page or something somewhere.. but wasnt sure.

 

2- yes i could, but WHMCS does everything else, so i wondered if it could somehow do this too :P

Link to comment
Share on other sites

1 -- I believe there is a feature to allow WHMCS to call a script when an order is placed -- you may want to look into this further, I can't remember exactly where this is set, I believe its either in Automation or General settings.

 

2 -- True, but if you have to manually count the SMSs, why not just do one more step and add an invoice?

Link to comment
Share on other sites

  • WHMCS CEO

You can add your own PHP code into the template files so you could add something to the submitticket-confirm.tpl file which is displayed once a ticket is opened to check the tickets priority and then send an SMS if needed.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I also think SMS would be great, I use it in my current Kayako setup and it is nice to just get a quick glimpse of what the ticket is. If it is something that is a certain priority then I can pull out the laptop, if it is something minimal that can wait it is good to know that also.

Link to comment
Share on other sites

  • 3 weeks later...

this is what we use with our support systems to notify by sms about certian tickets:

#! /usr/bin/php
<%
$db_server              = '';  # Database server
$db_name                = '';    # Database name
$db_user                = '';  # User to connect as
$db_pass                = '';# Password

# select priority support queues
# needs to be limited to non-spam only
$db_query_firstpass     = 'SELECT DISTINCT id, cemail, cdate FROM tt_ticket WHERE cat IN (18,16,15) AND status = 1 AND spam_count < 40';

$db_query_secondpass    =
'SELECT subject, content FROM tt_ticket_dat WHERE par_id = ';

# Connect to the database.
$db_link = mysql_connect($db_server, $db_user, $db_pass)
          or die ("Unable to connect to MySQL: " . mysql_error());

# Select appropriate database.
mysql_select_db($db_name)
       or die ("Unable to select database: " . mysql_error());

# Perform query.
$db_result = mysql_query($db_query_firstpass, $db_link)
            or die ("Unable to complete query: " . mysql_error());

# Parse and send items
while ($db_row = mysql_fetch_object($db_result)) {

       # One row retrieved as an object.
       $db_query_secondpass = $db_query_secondpass . $db_row->id;

       $db_result2 = mysql_query($db_query_secondpass,$db_link)
                     or die ("Unable to complete query: " . mysql_error());

       while ($db_row2 = mysql_fetch_object($db_result2)) {

               # One row retrieved as an object.
               # Construct message now both row, and data available.

               $messageSubject = "IH:" . $db_row->cemail . ":";
               $messageBody = $db_row2->content . ".";

               # substitute + for _ in $message to make readable
               # substitute %0D%0A for /

               $messageBody = str_replace("%0D%0A", "/", $messageBody);
               $messageBody = str_replace("%2A", "*", $messageBody);
               $messageBody = str_replace("%2C", ",", $messageBody);
               $messageBody = str_replace("%5C%5C%5C%27", "", $messageBody);
               $messageBody = str_replace("+", "_", $messageBody);

               $message = $messageSubject . substr($messageBody, 0, (158-strlen($messageSubject)));

               mail($phoneno."@".$smsservice, "SMS", $message);
               echo $message;
       }
       mysql_free_result($db_result2);
}

mysql_free_result($db_result);

mysql_close($db_link);
%>

 

feel free to adapt to suit your WHMCS setup :D

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated