Jump to content
DataTron.Network

Opening ticket after order is paid through hook [Working]

Recommended Posts

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);
});

 

Share this post


Link to post
Share on other sites

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}

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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