ForwardFirstMessage

From Request Tracker Wiki
Jump to navigation Jump to search

This code effectively re-sends the original email that was sent by the requestor and which caused the ticket to be created.

It's particularly useful to use it as a template when a ticket is assigned to another user (condition = On Owner Change; action = Notify Owner). For example, if your workflow includes people who will not login to RT to reply to tickets and who are not AdminCC on a queue, then this is the only way they can get the original email and reply to it.

{
 my $Transactions = $Ticket->Transactions;
 $Transactions->Limit( FIELD => 'Type', VALUE => 'Create' );
 my $first_message;
 my $CreateObj = $Transactions->First;
 if( $CreateObj && $CreateObj->id ) {
   $first_message = $CreateObj->Content;
 }

 $first_message;
}