Quantcast
Channel: WHMCS Community Forums
Viewing all articles
Browse latest Browse all 13458

Help with Simple openticket internal API

$
0
0
I'm trying to create a ticket when order is created, but for some reason I can't get hook to work. Would appreciate some feedback.

PHP Code:

<?php
if (!defined("WHMCS"))
    die(
"This file cannot be accessed directly");

function 
hook_newOrderTicket($vars) {
     
$ordernum $vars['ordernumber'];
     
     
$command "openticket";
      
$adminuser "adminusername";
     
//$values["clientid"] = "1";
     
$values["deptid"] = "5";
     
$values["subject"] = "Process Order #".$ordernum;
     
$values["message"] = "New order has been submitted. Order #".$ordernum." Review order information and begin processing it according to appropriate instructions. If you have any questions, contact your immediate supervisor.";
     
$values["priority"] = "High";
      
$values["noemail"] = "true";
     
$results localAPI($command,$values,$adminuser);

}
add_hook("AfterShoppingCartCheckout",1,"hook_newOrderTicket");
?>


Viewing all articles
Browse latest Browse all 13458

Trending Articles