bear Posted September 10 Share Posted September 10 Have an email notifier to let me know of new tickets. I'd really like to have the name of the person who opened it included, but notification merge files in the "default" template don't offer that. Even the email of the client that opened it would be helpful if not the name. Currently I get only Ticket opened (with link) and by user # at the end of that user's link. Any way to get the user name or email also? Can't seem to find it. Admin email notification only. 0 Quote Link to comment Share on other sites More sharing options...
keshav Posted Tuesday at 03:40 PM Share Posted Tuesday at 03:40 PM The merge fields are limited because that message comes from the Notifications feature (Configuration > System Settings > Notifications). Its email text is not a template, so the client name cannot be added there. The built-in admin email is the one to use: Go to Configuration > System Settings > Email Templates and open the Admin Messages group. Edit New Support Ticket Opened. The editor lists the fields you can use under Available Merge Fields; the client name and the ticket subject, department and message are among them. In Configuration > System Settings > Administrator Users, edit your admin and tick the departments under Support Ticket Notifications, otherwise that email is not sent to you. If you only need this email, you can then switch off the Notifications rule for new tickets so you do not get two messages for each ticket. Menu names are from WHMCS 8; in 7.x the same screens are under Setup. If the ticket is opened by a guest (no client account), the template has the name and email the person typed into the form. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted Wednesday at 01:37 PM Author Share Posted Wednesday at 01:37 PM 21 hours ago, keshav said: The built-in admin email is the one to use: Go to Configuration > System Settings > Email Templates and open the Admin Messages group. Edit New Support Ticket Opened. The editor lists the fields you can use under Available Merge Fields; the client name and the ticket subject, department and message are among them. That doesn't exist under admin emails or in fact anywhere in the email templates. 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted Wednesday at 05:28 PM Share Posted Wednesday at 05:28 PM (edited) Go to Configuration > Notifications and create a Notification Rule for New Ticket. Make sure you got Notification Message template in Email Templates > Notification Messages Edited Wednesday at 05:29 PM by pRieStaKos 0 Quote Link to comment Share on other sites More sharing options...
bear Posted Wednesday at 06:06 PM Author Share Posted Wednesday at 06:06 PM Thanks, but already did so. The issue is it's not grabbing any details of the sender/opener. Most of mine are done via email that's piped in, and the only time it will give an email is if the sender is a guest. Never gives a name. As soon as it recognizes someone as being in the system, it gives me a ticket link and a userid, both of which are useless, as I know where tickets are found, and haven't memorized userids/names to the point where I'd recognize them. No vars available that make a difference, either. 0 Quote Link to comment Share on other sites More sharing options...
keshav Posted Wednesday at 06:26 PM Share Posted Wednesday at 06:26 PM Sorry, my mistake on the name. In the list the template is called Support Ticket Created (Email Templates > Admin Messages). "New Support Ticket Opened" is only its subject line. Its default body already starts with: Client: {$client_name}{if $client_id} #{$client_id}{/if} So once you receive that email, you see the name without editing anything. It is sent only to admins who have the ticket's department ticked under Support Ticket Notifications on their admin user. That may be why you have never seen it, and why you only get the Notifications-rule message, which can't carry the name. If the template has been deleted on your install, or you would rather keep using your own email, a small hook does it. Save this as includes/hooks/ticket_open_admin_email.php: <?php use WHMCS\Database\Capsule; add_hook('TicketOpen', 1, function ($vars) { $c = Capsule::table('tblclients')->find($vars['userid']); $who = $c ? trim("$c->firstname $c->lastname") . " <$c->email>" : 'Guest'; localAPI('SendAdminEmail', [ 'customsubject' => "New ticket from $who: {$vars['subject']}", 'custommessage' => "<p>From: " . htmlspecialchars($who) . "</p><p>Ticket #{$vars['ticketid']}</p>" . nl2br(htmlspecialchars($vars['message'])), 'type' => 'support', 'deptid' => $vars['deptid'], ]); }); Because most of your tickets come in by email piping, test it with one piped message from a client address first. If piped tickets don't trigger it on your version, the TicketPiping hook point is the next thing to try. 0 Quote Link to comment Share on other sites More sharing options...
Solution bear Posted Wednesday at 08:59 PM Author Solution Share Posted Wednesday at 08:59 PM (edited) Asked support, and as predicted this is customization and not something they can help with. Would have been great if they mentioned the notification template is not editable as it lives behind the encoded files, which would have saved a lot of frustration, but hey! I'm guessing "New Support Ticket Opened." may have been a prior WHMCS version. Looking back in the email template sql files (v7x, v6x, v5x and so on), that was that title, but it was in support (not admin), and had client type info vars in it. So, for me, the workaround was to discontinue using the notifier (email) for support, which was sending to an account that had a special ring tone on my mobile so I know something's up. Instead set up the admin account to get notified for each support department (various triggers) via the admin account settings (appears this template is also hard coded somewhere), and changed the notifier to only send me items other than tickets. Last step, email filter to take messages to the admin addy and a subject that has "[Ticket ID" at the start and forward that to the special email addy with special ring tone. Best of both worlds, but still testing over time to make sure this doesn't bugger anything else up. Appreciate the responses, and hope this is of some use for someone. Phew. Edited Wednesday at 09:01 PM by bear 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted Wednesday at 09:18 PM Share Posted Wednesday at 09:18 PM Maybe with TicketOpen and SendAdminEmail 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.