jfreak53 Posted July 10, 2013 Share Posted July 10, 2013 No where in the documentation does it say whether this hook TicketAdminReply returns anything: http://docs.whmcs.com/Hooks:Support_Tickets I'm trying to have a way for this hook to change the admin user replying to a ticket. But I can't see if this or another hook returns anything changeable. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 10, 2013 Share Posted July 10, 2013 You need to make any changes directly in the database. e.g. update_query("tblticketreplies",array("admin" => $admin['firstname'] . " ". $admin['lastname']), array("id" => $params['replyid'])); 0 Quote Link to comment Share on other sites More sharing options...
jfreak53 Posted July 13, 2013 Author Share Posted July 13, 2013 Thanks, that works but the problem I'm having now is that the email is sent before the hook is activated, so my DB changes don't take affect but on the site. Back to the drawing board then thanks. - - - Updated - - - It also seems that it keeps updating the 'admin' column after my hook runs as no matter what I place there in that column it still keeps the posting user. - - - Updated - - - Scratch the second, I found the problem with the second not updating. But it's still sending email before the hook. 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted July 13, 2013 Share Posted July 13, 2013 If you aren't seeing the changes in the email then you would need to create an EmailPreSend hook and pass back a new variable containing the admin you would like to change the reply to and then update the email template to use this new variable. 0 Quote Link to comment Share on other sites More sharing options...
jfreak53 Posted July 13, 2013 Author Share Posted July 13, 2013 Aha! Let me give it a try then. 0 Quote Link to comment Share on other sites More sharing options...
jfreak53 Posted July 13, 2013 Author Share Posted July 13, 2013 Not working either, unfortunately that runs on the templates for emails and not on the ticket text sent. So it won't grab the variables in the ticket text during reply. I tried this and it won't replace it before sending the email: function PresendEmailTicket ( $vars ) { $merge_fields = array(); $merge_fields['test'] = 'tester2'; return $merge_fields; } add_hook("EmailPreSend", 2, "PresendEmailTicket"); 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.