Hi Masino,
I found the code within the two code boxes above and tried implementing the code within my email, but when a new ticket is created the %attachment is replaced, but nothing shows in the email.
This is what I've added.
if($resp && list($subj,$body)=db_fetch_row($resp)){
$body = str_replace("%ticket", $ticket->getExtId(),$body);
$body = str_replace("%name", $ticket->getName(),$body);
$body = str_replace("%email", $ticket->getEmail(),$body);
$body = str_replace("%priority", $ticket->getPriority(),$body);
$body = str_replace("%subject", $ticket->getSubject(),$body);
$body = str_replace("%dept", $dept?$dept->getName():'',$body);
$body = str_replace("%topic", $ticket->getTopicName(),$body);
//$body = str_replace("%attachmentname", $ticket->getAttachmentname(),$body);
$attachment = $ticket->getAttachmentStr($msg_row,'M');
$body = str_replace("%attachment", $attachment, $body);
$body = str_replace("%message",$var,$body);
$body_message = $var;
if($body_message == "Ticket created by staff") $body_message = $var;
$body = str_replace("%message",$body_message,$body);
$body = str_replace("%url", $cfg->getBaseUrl(),$body);
$sentlist=array();