Jump to content
Neklawy

ticket link replace URL in email template

Recommended Posts

Hello,

I would like to change the $ticket_url or $ticket_link outputs in support email template from

whmcsurl/viewticket.php?tid=2222&c=Pkjr2jgW

to the following format

whmcsurl/viewticket/2222-Pkjr2jgW

 

I tried replace {&ticket_link} to 

{$ticket_link|replace:'.php?tid=':'/'|replace:'&c=':'-'}
 
But that is not works :(
 
Can any one help me for make that via hook?
 
Thanks

Share this post


Link to post
Share on other sites

I already did that URL rewrites using htaccess and the URL format is works with me when request it in browser, But I would to change a base ticket link in Email support template

Thanks

Share this post


Link to post
Share on other sites
9 hours ago, Neklawy said:
But that is not works :(
But I would to change a base ticket link in Email support template

your code in the first post will work fine....

{$ticket_link|replace:'.php?tid=':'/'|replace:'&c=':'-'}

but the problem is that when you try to add it to the email template via the admin area, it will change & to &amp ; (space added before semi-colon to avoid the f0rum software changing it back to an ampersand!) when you save changes... and so that part of the replace will not work.

the easiest way to get it to work, would be to edit the email template directly in the database (via phpmyadmin or another tool) - doing that, you can enter the code exactly as you want to and it won't get changed by WHMCS... the templates are in tblemailtemplates and take a backup of the database just in case you run into issues.

Share this post


Link to post
Share on other sites

Yes @brian! you are right, the problem with &amp ;

I will try to edit that directly via phpMyAdmin if I can't write a hook

However, I tried to wrote a hook and I found these is works only inside clientarea templates not email templates 

function hook_ticket_seo_url($vars)
{
global $CONFIG;

$ticketid = $vars['tid'];
$tickethash = $vars['c'];

$newticketlink = $CONFIG['SystemURL'].'/ticket/'.$ticketid.'/'.$tickethash;

    return array("ticket_link" => $newticketlink);
}
add_hook("ClientAreaPage", 1, "hook_ticket_seo_url");
add_hook("EmailPreSend", 1, "hook_ticket_seo_url");

 

Any suggestion please?

Share this post


Link to post
Share on other sites
46 minutes ago, Neklawy said:

I will try to edit that directly via phpMyAdmin if I can't write a hook

if you want my suggestion, just edit the email template in the database - writing a hook for this is overkill when you can easily edit the template... also, you assume that these support ticket variables are easily accessible in a presend hook - that may be a false assumption. :)

48 minutes ago, Neklawy said:

However, I tried to wrote a hook and I found these is works only inside clientarea templates not email templates 

they're different beasts and just because a variable exists in a client area template, it doesn't necessarily mean that it will exist in an email template (and/or be called the same name), e.g., i'm not even sure the hash exists as a separate variable, so that may have to be pulled from the db... and in your example hook, $tid & $c would only be available on the viewticket page anyway, so a clientareapage hook would be the wrong hook to use even if this was for the client area.

i'd file this under "not worth wasting time on" when there is an easier solution. :idea:

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

  • Similar Content

    • By ModulesGarden
      1. Having multiple brands under your attentive care may feel at times like a cumbersome duty you would rather delegate to someone else. But no such bleak thought will ever cross your mind when you make the manifold utilities of our renowned Multibrand For WHMCS module a part of your everyday routine. 
      Additionally, we have just released a bulky 2.2.0 update of the tool so as to raise the suite of offered possibilities a level up. As a result, from this moment on you will be able to look up the desired branded invoice using the WHMCS ″Quick Search″ function, send blind carbon copies as well as carbon copies to the address specified in the branded email template, and let the ″Billable Items″ to be branded together with the invoices generated from them. 
      While we could shed more light on every single opportunity now ready for the taking, we simply do not want to deprive you of all the fun. Make your way to the module's changelog and rekindle your passion for multibranding craft! 
      Learn all about Multibrand For WHMCS 2.2.0!
       
      2. Bolstered with an array of various refinements, our Domain & Email Forwarding For WHMCS 1.3.0 module is worth of your attention now more than ever. 
      You may be particularly keen on noticing that your clients gained the means to adjust key attributes of domain and email forwarders via API, SSL mode for DirectAdmin server is now perfectly supported, and the ″Port″ field can now contain custom values. 
      We will not be taking any more of your precious time by enumerating all the fresh developments, while you can easily view them on our website! 
      Learn all about Domain & Email Forwarding For WHMCS 1.3.0!
       
      3. Customers who stand by you through thick and thin is the best form of gratification a company could ever wish for. And in this respect we are truly blessed, as recently the number of our own loyal supporters has skyrocketed to 20,000! 
      Today we would love to extend our appreciation to every single one of you, in whatever corner of the universe you are right now, with the first-class promotion that goes far beyond the mundane.
      Welcome with open arms the superb 33% discount compatible with the annual license of our products, and the no less attractive 11% promo code applying to open source software. Cannot decide which one to choose? Why not have both! 
      Make off with as many deals as you want!
       
      Need Custom Software Development For Your Business?

      Get Your Free Quote Now!


      Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
    • By Neklawy
      Hello,
      I want make a new file to call a ticket replies from db and adding featur for showing a single reply only by reply id or reply time for example if called a URL like
      history.php?tid=844130&c=1uT0TR8y&lastreply=1222

      Please advise me how I can do that
      Thanks in advanced
    • By sokalsondha
      Hello everyone
      thanks for reading my topics. i am having a big problem now with my whmcs. i have connect my gmail in my whmcs with SMTP. and its working fine.
      i want all other emails from my whmcs to my customers go from no-reply@mydomain.com so the clients can't reply that email
      only in my product details email i want it go from my gmail email address. so clients can reply that email and its comes to our gmail address
      but now i can see all emails like password reset order email invoice email all going to my clients from my gmail.
      if its happenning than i am scare that gmail could be block our email address
      how can i use SMTP for gmail only for that product details email.
      and other email need to go from domain email
      please someone help me
      do i need to make some hook?
      or is there any settings?
      this is my smtp settings http://prntscr.com/jhf2xc
      this is another setup http://prntscr.com/jhf391
      this is my product details email template http://prntscr.com/jhf3uo
      and this is system emails template  http://prntscr.com/jhf46n
       
      please someone help me
       
      it just one email i want to send out from gmail
      other all email from domain emails
      hope someone can help me
      Thanks in advance
       
      Mahim
    • By Aqib2001
      Hi, i wanted to know that how can i restrict users with unverified email addresses from accessing client area until they verify their email addresses.
    • By ModulesGarden
      1. There are several secret strategies to grow a lifelong client base. Our just rolled out Freshdesk For WHMCS 1.1.0 presents one of them, way more straightforward in its premise than you could have expected. Vamp up your ticket system with our brilliant in its simplicity tool and draw clients like a magnet!    Savor the ultra-light new framework powered up by the code rewritten from the ground up. Trace the record of module's actions and API responses in the just added 'Logs' section. Sort out your tickets in the Freshdesk admin panel more handily by letting your clients avail of the newly supported 'Client Services' field. Smooth the flow of information with three additional ticket statuses - 'New', 'Open', and 'Hold'. While exporting a selected group of clients, quickly preview their profile or opened tickets using a hyperlink.     If you believe in the principle that it is easier said than done, put all of the above powers to the test and bring your customer service to victory!    Learn All About Freshdesk For WHMCS 1.1.0!       2. It was not long ago that we drew the curtain on our New Year contest and the extra poll attached to it. Our heartfelt thanks go to all who put their doubts aside and joined this absorbing competition as well as the voting process. Be sure to expect even more interactive projects such as this one in the future. If you already suspect what is coming next, you are perfectly right – now, without further ado, it is time to reveal the promised winners!    Find out who got lucky!       Need Custom Software Development For Your Business?   Get Your Free Quote Now! Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines