Jump to content

Rewrite URLs for WHMCS


Recommended Posts

Hi,

 

We're stuck regarding our URL rewrites for the client area. We've been rewriting a lot of the URLs, but have run into one issue.

We're using the following code to rewrite the URLs for tickets:

#Support
RewriteRule ^tickets(/?)$ supporttickets.php?itemlimit=999999&thepage=help&subpage=support
RewriteRule ^ticket/([0-9]+)/([A-Za-z0-9]+)(/?)$ viewticket.php?tid=$1&c=$2&thepage=help&subpage=support
RewriteRule ^ticket/([0-9]+)/([A-Za-z0-9]+)/close$ viewticket.php?tid=$1&c=$2&closeticket=true&thepage=help&subpage=support

 

When the customer closes a ticket, /close is added to the URL. However, the email that is sent to the customer regarding ticket responses contains the "default" URL - when they access that URL, you can't just add /close at the end.

Is there something we can do in this case?

Link to comment
Share on other sites

it's little easy to change ticket URLs sent to clients email, using ActionHooks like the one below you can reformat the URL of these tickets,

all what you need is to check if the message is "Support Message", use $var['relid'] to get ticket information from DB and rebuild your URL as in website

 

<?php

add_hook("EmailPreSend", 1, function($vars){

if ($vars['messagename']=="Support Ticket Reply"){
   $ticketid = $vars['relid'];

   // get ticket ID and Code from DB

   return array("ticket_link" => "http://{your-website-url}/ticket/{ticketid}/{code}/");
}

});

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