Kayako logo
SupportSuite, eSupport and LiveResponse Discussion, troubleshooting and feedback related to Kayako's flagship support desk products SupportSuite, eSupport and LiveResponse.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1) Old
khoffman Offline
New Member
 
Posts: 14
Join Date: May 2006
Post [HOWTO] Show detailed ticket history in staff replies that looks good - 13-05-2006, 11:20 PM

I wanted to have the entire history of the ticket sent with each reply. Thanks goes to PhilEvans for pointing out how to do this. He didn't mention specifics, so I thought I'd post it here for easy pasting into your email_staffreply group template.

First, open the /admin area, go to Settings, and then Tickets. Scroll all the way to the bottom. Change "Assign Post List Variable to Staff Replies" to Yes.

Now, go to Templates, and start editing the email_staffreply template. Immediately after

Code:
<{if $ishtml == true}>
add the following (before the font tag):

Code:
<link rel="stylesheet" type="text/css" media="all" href="<{$swiftpath}>index.php?_ca=css" />
This includes the style sheet from the web site.

Now, after the /fieldset ends in the HTML part of the template, add the following:

Code:
<!-- TICKET HISTORY -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tborder" style="">
<thead>
<tr>
<td class="tcat" width="1" align="left" nowrap><img src="<{$themepath}>space.gif" width="4" height="21"></td>
<td class="tcat" width="100%" colspan="" align="left" nowrap><{$language[vtconversation]}></td>
</tr>
</thead>
<tbody>

<{foreach key=key value=post from=$postlist}>
<tr class="row1"><td align="left" valign="middle" colspan="2">

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td colspan="2" height="1" class="ticketline"><img src="<{$themepath}>space.gif" width="1" height="1" border="0" /></td></tr>
<tr><td width="200" align="left" style="PADDING: 4px;"><span class="ticketpostname"><{$post[fullname]}></span></td>
<td align="right">
<{if $post[creator] == "staff"}>
<img src="<{$themepath}>img_staff.gif" align="absmiddle" border="0" />
<{elseif $post[creator] == "thirdparty"}>
<img src="<{$themepath}>img_thirdparty.gif" align="absmiddle" border="0" />
<{elseif $post[creator] == "recipient"}>
<img src="<{$themepath}>img_recipient.gif" align="absmiddle" border="0" />
<{else}>
<img src="<{$themepath}>img_user.gif" align="absmiddle" border="0" />
<{/if}>
&nbsp;</td></tr>
<tr><td colspan="2" height="1" class="ticketline"><img src="<{$themepath}>space.gif" width="1" height="1" border="0" /></td></tr>
</table>

</td></tr>

<tr class="rowpost"><td align="left" valign="middle" colspan="2">

<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr><td width="1" align="left"><img src="<{$themepath}>icon_emailopen.gif" align="absmiddle" border="0" /></td>
<td align="left" width="100%"><span class="smalltext"><{$language[vtpostedon]}><{$post[date]}></span></td></tr>
<tr><td align="left" valign="top" colspan="2">
<hr class="tickethr" size="1">
<span class="mediumtext"><{$post[contents]}></span>

<{if $ticket[hasattachments] == "1" && $post[attachmentcount] > 0}>
<BR /><BR /><fieldset class="swiftfieldset"><legend><{$language[vtattachments]}></legend>
<{foreach key=attachkey value=attachment from=$post[attachments]}>
<span class="smalltext"><a href="<{$swiftpath}>index.php?_m=tickets&_a=getattachment&ticketid=<{$ticket[ticketid]}>&attachmentid=<{$attachment[attachmentid]}>"><img src="<{$themepath}><{$attachment[icon]}>" border="0" align="absmiddle" />&nbsp;<{$attachment[filename]}></a> (<{$attachment[attachmentsize]}>)</span><BR />
<{/foreach}>
</fieldset>
<{/if}>

</td></tr></table>

</td></tr>
<{/foreach}>

</td></tr></tbody></table>

<!-- END TICKET HISTORY -->
If you want the information included in the text part of the emails then add something like the following at the very end of the template (immediately before the last if)

Code:
<{foreach key=key value=post from=$postlist}>
======================================================================
Comment by <{$post[fullname]}> <{if $post[creator] == "staff"}>[Staff]<{elseif $post[creator] == "thirdparty"}>[3rd Party]<{elseif $post[creator] == "recipient"}>[Recipient]<{else}>[User]<{/if}> on <{$post[date]}>:
<{$post[contents]}>

<{/foreach}>
You will notice that in the HTML email the history looks exactly like how it looks when the user views the ticket when they're logged in (with the nice blue gradient at the top). Well, that's because the code was taken from the viewticket template. (Thanks again to PhilEvans for pointing this out).

Now, does anyone know how to increment a variable in the template language so I can limit the number of history entries to 5?
   
Reply With Quote
  (#2) Old
xian Offline
New Member
 
Posts: 29
Join Date: May 2006
22-05-2006, 12:16 PM

I appreciate the work that went into this post, much thanks. But is there any way to format the text version so that it looks good? It looks like the data is stored in XML in the DB or something, because my replies have:

><br />
><br />
> Ticket Details<br />
> ===================<br />
> Ticket ID: FST-433899<br />
> Department: General<br />
> Priority: Medium<br />
> Status: Open<br />
><br />
><br />
<br />
<br />
-- <br />

Is there a way to do search/replace from inside the template? Could I edit the cached PHP without worrying about breaking something? Is there a template language reference?

Shouldnt the staff replies (I saw another post about this) normally include the previous converstaion by default? Its crazy that we have to go through templates to do something every email client in the world has by default.
   
Reply With Quote
  (#3) Old
kaviar Offline
Member
 
Posts: 112
Join Date: Dec 2005
Location: Brisbane, Australia
30-05-2006, 02:10 AM

Hi,

Has anyone got this working for 3.0.90? Mine doesn't want to show the history.

Cheers
   
Reply With Quote
  (#4) Old
kbandrews Offline
New Member
 
Posts: 7
Join Date: Jun 2006
05-06-2006, 08:48 AM

I haven't been able to get this to work. This really should be an included option, along with allowing you to easily set the number of previous tickets you want to include. Just including the last one would often be enough I think.
   
Reply With Quote
  (#5) Old
elaconethosting Offline
New Member
 
Posts: 17
Join Date: Mar 2006
06-06-2006, 06:57 AM

Does this actually work?


Regards,
JJ

Elaconet Hosting: www.elaconethosting.com
   
Reply With Quote
  (#6) Old
thor Offline
New Member
 
Posts: 10
Join Date: May 2006
06-06-2006, 05:31 PM

No luck with me either using .90. I just get a blank table with the header row.

Edit: From what I can tell, $postlist is empty.

<!-- TICKET HISTORY -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tborder" style="">
<thead>
<tr>
<td class="tcat" width="1" align="left" nowrap><img src="http://helpdesk/supportsuite/themes/admin_default/space.gif" width="4" height="21"></td>
<td class="tcat" width="100%" colspan="" align="left" nowrap></td>
</tr>
</thead>
<tbody>
</td></tr></tbody></table>
<!-- END TICKET HISTORY -->

Last edited by thor; 06-06-2006 at 06:31 PM.
   
Reply With Quote
  (#7) Old
Varun Shoor Offline
Chief Executive Officer
 
Varun Shoor's Avatar
 
Posts: 2,829
Join Date: May 2003
07-06-2006, 11:57 PM

$postlist hasnt been tinkered with in .90, Are you sure its not something else? Is the setting enabled under Admin CP > Settings > Tickets

Regards,

Varun Shoor


Varun Shoor (varun.shoor ]at[ kayako.com)
----------------------------------------------------------------
---
   
Reply With Quote
  (#8) Old
Tom Sommer Offline
New Member
 
Posts: 2
Join Date: Jun 2006
09-06-2006, 08:54 AM

Why is <{$post[contents]}> filled with HTML data? That makes it virtually impossible to use it in the plain text part of the template.

Also, one could wish there was an easy way to indent the $postdata with ">" in order to signify the ticket history

Last edited by Tom Sommer; 09-06-2006 at 09:03 AM.
   
Reply With Quote
  (#9) Old
thor Offline
New Member
 
Posts: 10
Join Date: May 2006
Smile 09-06-2006, 04:30 PM

Quote:
Originally Posted by Varun [K]
$postlist hasnt been tinkered with in .90, Are you sure its not something else? Is the setting enabled under Admin CP > Settings > Tickets

Regards,

Varun Shoor
Thanks Varun, I didn't think of checking that. I don't remember changing it, but I'll ask my staff as well.

Thanks again
   
Reply With Quote
  (#10) Old
xian Offline
New Member
 
Posts: 29
Join Date: May 2006
16-06-2006, 02:12 PM

Quote:
Originally Posted by Tom Sommer
Why is <{$post[contents]}> filled with HTML data? That makes it virtually impossible to use it in the plain text part of the template.
My gripe exactly. Have you found a way around this? Luckily 95% of my emails are single replies, but it would be nice to have the option.

The only other thing is the "Q" icon, but it would be nice if that included a message like:

On 06/12/2006 Bob Dole said:
> Dole in 2008!
> Thanks.
> Bob.

Instead of just the message. Anyone know how to do this?
   
Reply With Quote
  (#11) Old
khoffman Offline
New Member
 
Posts: 14
Join Date: May 2006
17-06-2006, 03:15 PM

Just to make it clear, here is the entire contents of my email_staffreply template. Like varun said you have to enable filling the contents of $postlist in the Admin CP Ticket settings.

Note that this also includes part of the code for having a logo at the top and to automatically log them in, so you'll need to remove that if you don't want to use it.

Code:
<{if $ishtml == true}>
<link rel="stylesheet" type="text/css" media="all" href="<{$swiftpath}>index.php?_ca=css" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="52%" align="left"><a href="https://secure.efoldering.com/"><img src="https://secure.efoldering.com/images/eFolder-logo-image.gif" border="0"></a></td>
        <td width="48%" align="right" valign="bottom"><span class="smalltext"><a href="https://secure.efoldering.com/">[Web Portal]</a> <a href="<{$swiftpath}>?group=efolder&_m=tickets&_a=viewticket&ticketid=<{$ticket[ticketid]}>&u_email=<{urlencode value=$ticket[email] }>&u_login=1">[Support Center]</a></span> </td>
      </tr>
    </table>
</td></tr>
<tr><td>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="2" bgcolor="#3894E5"><img src="<{$themepath}>space.gif" width="1" height="2"></td>
      </tr>
      <tr>
        <td height="6" bgcolor="#83BFF5"><img src="<{$themepath}>space.gif" width="1" height="6"></td>
      </tr>
      <tr>
        <td height="5" bgcolor="#C3E3FF"><img src="<{$themepath}>space.gif" width="1" height="5"></td>
      </tr>
    </table>
</td></tr>
</table><BR>
<font face="Verdana, Arial, Helvetica" size="2"><{$contentshtml}>
<BR><BR>
<fieldset style="margin-bottom: 6px; color: #333333;FONT: 11px Verdana, Tahoma;PADDING:3px;">
<legend><{$language[ticketdetails]}></legend><BR>
<{$language[articketid]}><{$ticket[fticketid]}><BR>
<{$language[ardepartment]}><{$ticket[department]}><BR>
<{$language[arpriority]}><font color="<{$priority[frcolorcode]}>"><{$ticket[priority]}></font><BR>
<{$language[arstatus]}><font color="<{$status[statuscolor]}>"><{$ticket[status]}></font><BR>
</fieldset>
</font>

<!-- TICKET HISTORY -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tborder" style="">
<thead>
<tr>
<td class="tcat" width="1" align="left" nowrap><img src="<{$themepath}>space.gif" width="4" height="21"></td>
<td class="tcat" width="100%" colspan="" align="left" nowrap><{$language[vtconversation]}></td>
</tr>
</thead>
<tbody>

<{foreach key=key value=post from=$postlist}>
<tr class="row1"><td align="left" valign="middle" colspan="2">

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td colspan="2" height="1" class="ticketline"><img src="<{$themepath}>space.gif" width="1" height="1" border="0" /></td></tr>
<tr><td width="200" align="left" style="PADDING: 4px;"><span class="ticketpostname"><{$post[fullname]}></span></td>
<td align="right">
<{if $post[creator] == "staff"}>
<img src="<{$themepath}>img_staff.gif" align="absmiddle" border="0" />
<{elseif $post[creator] == "thirdparty"}>
<img src="<{$themepath}>img_thirdparty.gif" align="absmiddle" border="0" />
<{elseif $post[creator] == "recipient"}>
<img src="<{$themepath}>img_recipient.gif" align="absmiddle" border="0" />
<{else}>
<img src="<{$themepath}>img_user.gif" align="absmiddle" border="0" />
<{/if}>
&nbsp;</td></tr>
<tr><td colspan="2" height="1" class="ticketline"><img src="<{$themepath}>space.gif" width="1" height="1" border="0" /></td></tr>
</table>

</td></tr>

<tr class="rowpost"><td align="left" valign="middle" colspan="2">

<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr><td width="1" align="left"><img src="<{$themepath}>icon_emailopen.gif" align="absmiddle" border="0" /></td>
<td align="left" width="100%"><span class="smalltext"><{$language[vtpostedon]}><{$post[date]}></span></td></tr>
<tr><td align="left" valign="top" colspan="2">
<hr class="tickethr" size="1">
<span class="mediumtext"><{$post[contents]}></span>

<{if $ticket[hasattachments] == "1" && $post[attachmentcount] > 0}>
<BR /><BR /><fieldset class="swiftfieldset"><legend><{$language[vtattachments]}></legend>
<{foreach key=attachkey value=attachment from=$post[attachments]}>
<span class="smalltext"><a href="<{$swiftpath}>index.php?_m=tickets&_a=getattachment&ticketid=<{$ticket[ticketid]}>&attachmentid=<{$attachment[attachmentid]}>"><img src="<{$themepath}><{$attachment[icon]}>" border="0" align="absmiddle" />&nbsp;<{$attachment[filename]}></a> (<{$attachment[attachmentsize]}>)</span><BR />
<{/foreach}>
</fieldset>
<{/if}>

</td></tr></table>

</td></tr>
<{/foreach}>

</td></tr></tbody></table>

<!-- END TICKET HISTORY -->

<{else}><{$contentstext}>

<{$language[ticketdetails]}>
===================
<{$language[articketid]}><{$ticket[fticketid]}>
<{$language[ardepartment]}><{$ticket[department]}>
<{$language[arpriority]}><{$ticket[priority]}>
<{$language[arstatus]}><{$ticket[status]}>

<{foreach key=key value=post from=$postlist}>
======================================================================
Comment by <{$post[fullname]}> <{if $post[creator] == "staff"}>[Staff]<{elseif $post[creator] == "thirdparty"}>[3rd Party]<{elseif $post[creator] == "recipient"}>[Recipient]<{else}>[User]<{/if}> on <{$post[date]}>:
<{$post[contents]}>

<{/foreach}>

<{/if}>
   
Reply With Quote
  (#12) Old
tm2000 Offline
Member
 
Posts: 42
Join Date: Aug 2005
20-06-2006, 12:30 AM

Here is the CSS needed - may be a couple extra classes... Works great on Yahoo, MSN, AT&T WebMail.. Everything except GMail

THANKS to khoffman for making this work!!!

Code:
<{if $ishtml == true}>
<style type="text/css">
<!--

.tcat
{
	background: #80A9EA url(http://support.360ods.com/themes/client_default//tablebg.gif) repeat-x top left;
    COLOR: #FFFFFF;
	FONT: 12px Verdana, Tahoma;
}

.tabletitlerow
{
	BACKGROUND: #80A9EA url(http://support.360ods.com/themes/client_default//tabledescbg.gif) REPEAT-X TOP LEFT;
    COLOR: #113265;
	FONT: 11px Verdana, Tahoma;
}

.contenttableborder
{
	background: #D1DCEB;
	color: #FFFFFF;
}
.tborder
{
	background-color: #FFFFFF;
	color: #000000;
	border: 1px solid #6393DF;
}
.mediumtext
{
    FONT-SIZE: 12px;
    COLOR: #333333;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}

.smalltext
{
    FONT-SIZE: 11px;
    COLOR: #333333;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}

.ticketpostname
{
    FONT-SIZE: 18px;
    COLOR: #333333;
    FONT-FAMILY: Trebuchet MS, Verdana, Arial, Helvetica;
}
.ticketsubject
{
	COLOR: #333333;
    FONT-SIZE: 12px;
    FONT-FAMILY: Verdana, Arial, Helvetica;
	FONT-WEIGHT: bold;
}

.row1
{
	BACKGROUND-COLOR: #EDF4FF;
	COLOR: #000000;
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}

.row2
{
	BACKGROUND-COLOR: #F7FAFF;
	COLOR: #000000;
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}

.row3
{
	BACKGROUND-COLOR: #FFF8E9;
	COLOR: #000000;
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Arial, Helvetica;
}

.tborder
{
	background-color: #FFFFFF;
	color: #000000;
	border: 1px solid #6393DF;
}

.ticketline
{
	BACKGROUND-COLOR: #96B9F0;
}

.tickethr
{
	BACKGROUND-COLOR: #D1DCEB; COLOR: #D1DCEB; BORDER: 0; HEIGHT:1px; MARGIN-TOP: 0; MARGIN-BOTTOM: 8; 
}

.tbordererror
{
	background-color: #FFFFFF;
	color: #000000;
	border: 1px solid #E82A2A;
}

.errorbox
{
	background-color: #FFEAEA;
	color: #333333;
    FONT-SIZE: 11px;
    FONT-FAMILY: Verdana, Arial;
}
.tcat
{
	background: #80A9EA url(http://support.360ods.com/themes/client_default//tablebg.gif) repeat-x top left;
    COLOR: #FFFFFF;
	FONT: 12px Verdana, Tahoma;
}

.tabletitlerow
{
	BACKGROUND: #80A9EA url(http://support.360ods.com/themes/client_default//tabledescbg.gif) REPEAT-X TOP LEFT;
    COLOR: #113265;
	FONT: 11px Verdana, Tahoma;
}

.contenttableborder
{
	background: #D1DCEB;
	color: #FFFFFF;
}
.tborder
{
	background-color: #FFFFFF;
	color: #000000;
	border: 1px solid #6393DF;
}
.redtext
{
    FONT-SIZE: 11px;
    COLOR: red;
    FONT-FAMILY: Verdana, Arial;
}
.swiftfieldset { margin-bottom: 6px; color: #267DDC; BORDER: 1px SOLID #CCCCCC; -moz-border-radius: 4px 4px 4px 4px; padding: 4px}
.swiftfieldset, .swiftfieldset td, .swiftfieldset p, .swiftfieldset li { FONT: 11px Verdana, Tahoma; }
-->
</style>
<!--<link rel="stylesheet" type="text/css" media="all" href="<{$swiftpath}>index.php?_ca=css" />-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">

.....  
then the rest of the code per Post.....
   
Reply With Quote
  (#13) Old
khoffman Offline
New Member
 
Posts: 14
Join Date: May 2006
11-07-2006, 08:50 AM

I couldn't find a workaround for gmail either. I'd be interested if anyone else has experience in getting around gmail's smart filtering. (Perhaps using javascript to write the CSS? I haven't tried it.)
   
Reply With Quote
  (#14) Old
eiden Offline
Member
 
Posts: 237
Join Date: Apr 2006
Location: Norway
11-07-2006, 09:12 AM

This guide contains a lot of useful info/tips on how to design HTML emails:
http://www.mailchimp.com/resources/h...ail_design.pdf

Look at pages 11 and 29.


This is what the guide says about GMail:

Extremely aggressive spam filters. And very, very little CSS support. It strips embedded CSS, (even if you
keep the CSS out of the <HEAD> tag). It also strips every “class” code that it finds (such as in <span
class=”header”>). To get CSS to work in Gmail, you’ll need to use inline styles.
   
Reply With Quote
Reply

Tags
detailed, good, history, howto, staff, ticket

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send Complete History in Staff Replies puppy SupportSuite, eSupport and LiveResponse 0 12-12-2006 09:56 PM
Kayako SupportSuite v3.04.10 Stable Build Varun Shoor News and Announcements 2 06-10-2006 09:41 PM
Email replies in ticket history kumann SupportSuite, eSupport and LiveResponse 0 07-09-2006 11:28 AM
Ticket replies by staff kumann SupportSuite, eSupport and LiveResponse 1 01-09-2006 06:02 AM
v3.00.27 Stable Available Varun Shoor News and Announcements 1 05-12-2005 09:21 PM



Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46