Based on what I have seen on the list, I have the following template to include the contents (correspond, email body) of the last ticket being sent:

RT-Attach-Message: yes

{ ### Get last Correspond
   my $Transactions = $Ticket->Transactions;
   $Transactions->Limit( FIELD => 'Type', VALUE => 'Correspond' );
   $Transactions->OrderByCols (
      { FIELD => 'Created',  ORDER => 'DESC' },
      { FIELD => 'id',     ORDER => 'DESC' },
   );
   my $CorrespondObj = $Transactions->First;
   if ($CorrespondObj && $CorrespondObj->Id) {
     $c_content = $CorrespondObj->Content;
     chomp $c_content;

   }
   $c_content
}

Now that takes care of the text part of the ticket, but what to do when a given ticket has an attachment -- say, a picture -- and I would like to keep it?

--------
2011 Training: http://bestpractical.com/services/training.html

Reply via email to