DataTron.Network Posted May 12, 2019 Share Posted May 12, 2019 My hook function works by opening ticket through support system after order is paid, but I am also trying to add to it by allowing the message to output a message displaying the 'Hosting Account Welcome Email' email template with the following 'Available Merge Fields' so that it will display the account information inside of the ticket when its created. Example field to display: {$service_product_name} <?php add_hook('OrderPaid', 1, function($vars) { $command = 'OpenTicket'; $postData = array( 'deptid' => '1', 'subject' => 'Your server is ready!', 'message' => 'We are pleased to inform you that your server is ready. Please check your emails, thank you.', 'clientid' => $vars['userId'], 'priority' => 'High', 'markdown' => true, ); $results = localAPI($command, $postData); print_r($results); }); 0 Quote Link to comment Share on other sites More sharing options...
DataTron.Network Posted May 12, 2019 Author Share Posted May 12, 2019 Would I have to use database queries? 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 13, 2019 Share Posted May 13, 2019 Yes. This is the pseudo-query. SELECT server, username, password FROM tblhosting WHERE id = {YOUR_ID} I also included server ID and don't forget to Decrypt($password) otherwise it will be encrypted. Maybe you should also join this table with tblservers like I did below. The reason is that probably you'll need the URL to Plesk, cPanel, DirectAdmin or whatever panel you're using. SELECT t1.server, t1.username, t1.password, t2.ipaddress, t2.hostname FROM tblhosting AS t1 LEFT JOIN tblservers AS t2 ON t1.server = t2.id WHERE t1.id = {YOUR_ID} 1 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.