Jump to content

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

 

Link to comment
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}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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