One of our customers is also Amazon reseller. There isn't a variable available in the ticket reply email template for this, so we've created the following code:
{php}
$result = select_query("tbltickets", "id,date,message", array("tid" => $this->_tpl_vars['ticket_id']));
while($data = mysql_fetch_array($result))
{
$result2 = select_query("tblticketreplies", "date,message", array("tid" => $data['id']), "id", "DESC");
while($data2 = mysql_fetch_array($result2))
{
echo "----------------------------------------------<br />\n";
echo $data2['date']."<br />\n";
echo "----------------------------------------------<br />\n";
echo $data2['message']."<br />\n";
}
echo "----------------------------------------------<br />\n";
echo $data['date']."<br />\n";
echo "----------------------------------------------<br />\n";
echo $data['message']."<br />\n";
}
{/php}