Strik Posted March 29, 2017 Share Posted March 29, 2017 Hello, I still use version 4 of WHMCS and created hook called TicetOpen. Here is my code: <?php function SendSMS_NewTicket($vars) { $userid = $vars['userid']; $message = $vars['message']; $priority = $vars['priority']; $subject = $vars['subject']; $username = ''; $lastname = $vars['lastname']; $password = ''; $destination = ''; $source = 'Transfer'; $text = "$subject"; $content = 'action=sendsms'. '&user='.rawurlencode($username). '&password='.rawurlencode($password). '&to='.rawurlencode($destination). '&from='.rawurlencode($source). '&text='.rawurlencode($text); $smsglobal_response = file_get_contents('http://www.smsglobal.com.au/http-api.php?'.$content); } add_hook("TicketOpen",1,"SendSMS_NewTicket"," "); ?> I want to receive SMS if customer created ticket, all goes good, but I can't get customer First and Last name. This should be easy to get in new versions, but I cannot do this in WHMCS 4. Can anybody suggest mysql query or any way to get Client full Name? Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 29, 2017 Share Posted March 29, 2017 v4 is a little before my time, but I doubt WHMCS database structure has changed much between 4 and 5... if so, it should be something along the lines of.. SELECT CONCAT(firstname,' ',lastname) FROM tblclients WHERE id=$userid that's if you wanted the full name - but if you were wanting them separately, then you wouldn't need the concat and could just select both firstname and lastname in the query. 0 Quote Link to comment Share on other sites More sharing options...
twhiting9275 Posted March 30, 2017 Share Posted March 30, 2017 Best answer is going to be one you don't want to hear. Update your older than dirt software. v4 is incredibly out of date and relies on EOL versions of PHP Your addons will likely have to be reworked, ut come on, you're exposing your server and billing client (you know, your bread and butter) to massive vulnerabilities here 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.