SPICEWORKS SUPPORT STYLE TEMPLATE

EDIT: I realized after a bit that I had left off the code that allows users and administrators to see, not just that the ticket was closed, but by whom and with what comment. I've added that to both sections of the template and it's now working.

So, I absolutely loved the template that the fine folks at Spiceworks support use and so I asked if they could share the code, but alas they could not. So, I set about to create a semi-acceptable replica of said template. Here's my first stab at it.

Source Code

This script has not been checked by Spiceworks. Please understand the risks before using it.

Screenshots

16 Comments

I just realized, I don't have a spot like Spiceworks uses with a section at the bottom for knowledge base articles or tutorial videos or something, as well as a footer. I'll work on that and add those features to an updated version.
Thanks to those who've already downloaded it, I'd like to hear what you think if you happen to see this comment.

I've been trying to find some help with a email template scripting issue, maybe you can help me. I have a custom field on my tickets called Type (ticket.c_type). When the ticket closes I want to send a different closing message to tickets with the type being Incident. How can I add that requirement to your script and still retain the case statements for the recipients as well?

Will this be just for admins or for the user as well? I think the closing logic sends the same message to both the user and the admin at the moment, at least in this version of my script, basically, like this:
Ticket #xxxx was closed on Apr 21, 2017 @ 09:15 am. by Admin
With the comment: Ticket closed: Swapped out PS. All OK
This I'm pretty sure is the logic you're looking for:
{% when 'admin' or 'helpdesk_admin' %}
<p style="font-style: italic; font-size: 16px; margin-bottom: 10px;"><strong>Ticket #{{ticket.id}} was closed on {{ticket.closed_at | date_sw}}. by {{ticket.last_comment.creator.full_name_or_email}}</strong></p>
<p style="font-style: italic; font-size: 16px; margin-bottom: 10px;">With the comment:</p>
<p style="margin-bottom: 10px; font-size: 16px;">{{ticket.last_comment.body | escape | simple_format}}</p>
I would try adding the custom type at the bottom of that part, that's the case in which the admin is the recipient after a close. I'm assuming you don't really care if the users know what type the ticket was, but if you did, there's another similar statement right above this part and it should adjust the recipients email when it's just a user.

ok let me go back a step... lol
I want the recipient statement to remain the same as is. but... We ask users to fill out a customer Sat survey on tickets that are tagged in the custom field "type" (ticket.c_type) as Incident. Currently we send to the link to all tickets that are closed regardless of type and would like to filter that down. Surveys are not required for Problem, Request, and Query ticket types, just Incident. We'd like it to send the link on the closing email on tickets that are Incidents only.
I hope that's clear enough. It is the end of the day for me and my brain is mush.

So what survey are you using? Is it the one that's built by Spiceworks or is it something different? I've only installed the one that they offer and it only offers 1 question. I haven't even looked at it yet with regards to the ticket template, I'm still triggering those manually.
I would assume though that it's an additional loop that would need to be added to the admin closing loop. I'll see if I can toy around with it a little bit today or tomorrow. We're pretty swamped but who knows, maybe I can at least get started on it.

Hi Eric, not sure if you're still working on this, but a friend of mine who's a rails guy thinks, an if then, inside the when case should work, something like: {%if ticket.c_type == 'Incident' %} survey link ... {%endif%} and place it before the end case statement.

Hi Ann, as far as I know everything with the cc works perfectly. We generally don't use the cc option very much but I haven't had anybody say that it wasn't working.
I'll take a look and see if I can figure out if there is a way to signify to the user that they are being cc'd. If I can, I'll put it in the source code with a comment, then if you want to enable it you just remove the comment tags and it'll be active.
I'll let you know though either way, if I'm unable to do that or if I can.

Dave6696, thanks for the quick response. With our template, if the creator cc's others, I will accept and reply to the help desk ticket. Right now, unless I look at Details I can't see that he'd cc'd others. Suddenly I'll get a response from one of the cc'd saying "Check with XXX, they'd have a better response/know more....etc." They don't see that they're a cc and XXX was the creator although it's in the Ticket Overview. We are using the standard template that came with the helpdesk system. I want to find a nicer looking one with the cc'd people able to quickly realize they're being cc'd /FYI'd.

Hi Ann, so in this template, the users that are CC'd show up in the left column and it just says CC, but you could change that to be more noticeable if you wanted to. Look at line 73 in the source code, where it says <strong>CC:</strong>. If you wanted to, you could just change that to <strong>THE FOLLOWING USERS ARE BEING COPIED ON THIS TICKET</strong>. As far as I know after digging around, the email template that gets sent is identical for a CC user or the creator, so without changing the mechanics behind the scenes with a plugin or something there's not a way to send them a different notification email, so this may be your best bet. If you wanted to highlight it in a different color you could do that easily enough as well, change <strong> to <strong style="color: red;"> and that would bold and change the text to red. There is also the option of changing the verbiage when the person receives the ticket when it's first opened, you could say, "If you did not create this ticket, you are being copied for status updates, please do not reply unless pertinent to the ticket", add it to it's own line and then maybe send out an email to everyone to indicate the new changes that were added.