Jump to content

TicketOpen Hook - How to prevent / stop creating an ticket


ZeroMB
Go to solution Solved by DennisHermannsen,

Recommended Posts

I am using the code below for the TicketOpen hook, but it fails to prevent WHMCS from creating a ticket.

// Check if the response is uniqueword and stop generating an ticket
if (trim($response) === 'uniqueword') {
    // Log the activity
    logActivity('Sorry no uniqueword');
    
    // Set message to an empty string to prevent ticket opening
    $vars['message'] = '';

    // Return a message to stop further processing
    return 'You are not allowed to open a ticket';
}

 

Only the die() statement works to prevent users from creating a ticket.

I even tried setting the message field to an empty string so WHMCS would throw an error, but nothing happened. Any solutions?

 

I only want to show an error when registered/unregistered user creating an ticket. Eg: If unique-word = true, stop creating an ticket and show error on ticket page.

Edited by ZeroMB
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.

×
×
  • 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