PDA

View Full Version : SMS Intergration to WHMCS



chisel
01-25-07, 01:20 AM
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?

adakist
01-25-07, 01:52 AM
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?

chisel
01-25-07, 02:17 AM
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

adakist
01-25-07, 02:50 AM
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?

Matt
01-25-07, 08:41 AM
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.

chisel
01-25-07, 11:17 AM
Excellent, just what i'm after.

Cheers :)

dannygoh
01-25-07, 09:27 PM
chisel,

hopefully you able to share your code after you have successfully integrated into whmcs

chisel
01-25-07, 11:40 PM
will do:)

dannygoh
01-26-07, 02:07 AM
will do:)

thanks :D

tj
02-04-07, 02:54 PM
will do:)

thanks :D

Oooh yes please! :D

Canaduh
03-12-07, 03:09 AM
Any word on this?

onuzra
03-13-07, 06:51 PM
SMS is too important for Internet shopping. I think its's must be on whmcs

okihost
03-13-07, 07:35 PM
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.

JohnLB
03-29-07, 01:44 PM
Is there any word on this?
Any script being shared yet?

othellotech
03-30-07, 10:44 AM
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

JohnLB
03-31-07, 09:21 AM
Did anyone get this to work?

Rebel
04-01-07, 02:42 AM
othellotech thanks -- SMS is a great way to stay on top of things

majedbiz
01-26-09, 12:04 AM
Hi SHisel

Are sripts finish :lol: