Jump to content
DennisMidjord

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?

Share this post


Link to post
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}/");
}

});

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