aonap Posted April 11, 2020 Share Posted April 11, 2020 When clients reply via email, how do you get the system to remove our last response? Effectively, want to ensure that the tickets only show their new message. This needs to be a feature as we were used to it with Zendesk. 0 Quote Link to comment Share on other sites More sharing options...
zitu4life Posted April 11, 2020 Share Posted April 11, 2020 (edited) 8 hours ago, aonap said: When clients reply via email, how do you get the system to remove our last response? Effectively, want to ensure that the tickets only show their new message. This needs to be a feature as we were used to it with Zendesk. Welcome to WHMCS ticket import system. It is not possible out of the box and no better way to solve it. Yes it is bored, because when you read a ticket you need to deal with a lot things (HTML codes, css, lot of garbage)...Also there is no module to get it better, and WHMCS perhaps do not care a lot about it, because usually I guess all WHMCS clients usually log in before answer their ticket, but we know in our real lives our clients do not do that, and get us on mess. My clients usually find me at my local office or phone call, so We manual register them on admin side, so they are not familiar to login in their client area. This means they usually reply all tickets direct to their email, so 90% of my tickets has this mess garbage on there (importing all previous message). But yes We still a live, waiting that someday it could get better 🤞 Edited April 11, 2020 by zitu4life correct word their to they 2 Quote Link to comment Share on other sites More sharing options...
Plambee Posted April 11, 2020 Share Posted April 11, 2020 You can try this hook: https://github.com/Jetserver/WHMCS-Reply-Above-This-Line 3 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted April 11, 2020 WHMCS Support Manager Share Posted April 11, 2020 Hi @aonap, This is certainly possible! Add the line to the email template via Setup > Email Templates. Then add the same to the tblticketbreaklines table. 1 Quote Link to comment Share on other sites More sharing options...
aonap Posted April 13, 2020 Author Share Posted April 13, 2020 Thanks all this has been helpful. 0 Quote Link to comment Share on other sites More sharing options...
aonap Posted April 13, 2020 Author Share Posted April 13, 2020 On 4/11/2020 at 11:24 AM, bady said: You can try this hook: https://github.com/Jetserver/WHMCS-Reply-Above-This-Line This does not work on the latest WHMCS? Suggestions? 0 Quote Link to comment Share on other sites More sharing options...
Plambee Posted April 13, 2020 Share Posted April 13, 2020 Right, the hook still uses the mysql db connection, try to replace $sql = "UPDATE tblticketreplies SET message = '" . mysql_real_escape_string(trim($message)) . "' WHERE id = '" . intval($vars['replyid']) . "'"; mysql_query($sql); with Capsule::connection()->statement("UPDATE tblticketreplies SET message = '" . mysql_real_escape_string(trim($message)) . "' WHERE id = '" . intval($vars['replyid']) . "'"); and add use Illuminate\Database\Capsule\Manager as Capsule; after the <?php 0 Quote Link to comment Share on other sites More sharing options...
aonap Posted April 13, 2020 Author Share Posted April 13, 2020 <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); /********************* Reply Above This Line Settings *********************/ function ReplyAboveThisLine_settings() { return array( 'breakrow' => "*** Reply above this line ***", // this line will be added to the selected email. * all content below this line will be deleted from the client reply. ); } /********************/ function ReplyAboveThisLine_cleanReply($vars) { $settings = ReplyAboveThisLine_settings(); if(strpos($vars['message'], $settings['breakrow']) !== false) { list($message) = explode($settings['breakrow'], $vars['message']); Capsule::connection()->statement("UPDATE tblticketreplies SET message = '" . mysql_real_escape_string(trim($message)) . "' WHERE id = '" . intval($vars['replyid']) . "'"); } } function ReplyAboveThisLine_addBreakRow($vars) { return ReplyAboveThisLine_settings(); } add_hook('EmailPreSend', 0, 'jetserverReplyAboveThisLine_addBreakRow'); add_hook('TicketUserReply', 0, 'jetserverReplyAboveThisLine_cleanReply'); use Illuminate\Database\Capsule\Manager as Capsule; ?> Is the above correct? 0 Quote Link to comment Share on other sites More sharing options...
aonap Posted April 16, 2020 Author Share Posted April 16, 2020 The code is not working 😕 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 17, 2020 Share Posted April 17, 2020 (edited) 9 hours ago, aonap said: The code is not working that "use" needs to be before you call a capsule query - as it's written, you're asking WHMCS to use capsule, but it has no idea what to use to do that. so move it from the bottom of the hook to the top, after <?php and before the first function is called. use WHMCS\Database\Capsule; either bady's (the original way we were told to call Capsule) or the above (the more recent way) should work. Edited April 17, 2020 by brian! 0 Quote Link to comment Share on other sites More sharing options...
aonap Posted April 17, 2020 Author Share Posted April 17, 2020 40 minutes ago, brian! said: that "use" needs to be before you call a capsule query - as it's written, you're asking WHMCS to use capsule, but it has no idea what to use to do that. so move it from the bottom of the hook to the top, after <?php and before the first function is called. use WHMCS\Database\Capsule; either bady's (the original way we were told to call Capsule) or the above (the more recent way) should work. It is working! Thank you. Only issue now is when we get the admin ticket replies, it is still showing the full email. We are trying to save space on the DB server, so how do you get rid of the content below? In the support ticket at the backend it shows still parts of the email: From: Sent: To: Subject: 0 Quote Link to comment Share on other sites More sharing options...
sol2010 Posted August 16, 2022 Share Posted August 16, 2022 On 4/11/2020 at 10:12 PM, zitu4life said: ........ This means they usually reply all tickets direct to their email, so 90% of my tickets has this mess garbage on there (importing all previous message)...... Have you tried with the breaklines method? Works for me. https://help.whmcs.com/m/support_tools/l/1265973-stripping-quoted-emails-from-tickets 0 Quote Link to comment Share on other sites More sharing options...
SVCode Posted September 17, 2023 Share Posted September 17, 2023 I just added: <p>====== Please reply above this line ======</p> To the mail header: General Settings Mail Client Email Header Content Below: </head> <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> <center> So I end up with: </head> <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0"> <center> <p>====== Please reply above this line ======</p> <table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable"> Not really sure why this, or something like it, isn't already the default? Cloudflare OWASP rules seems to otherwise block page loads/submits, when clients try to post a reply to a ticket that has various URLs in - imported from the email replies. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.