[rt-users] Having the last transaction (or the full ticket) in emails on queue or owner changes

L B bertignac at gmail.com
Wed Jun 29 03:01:31 EDT 2011


Here is a version a bit improved :


Last correspondence of the ticket:
==================================

{
my $txns = $Ticket->Transactions;
$txns->Limit(
FIELD    => 'Type',
VALUE    => $_,
) for qw(Create Correspond Comment);

my $last_content;
my $AttachmentObjects = $txns->Last()->Attachments;
while( my $at = $AttachmentObjects->Next()){
        next if $at->ContentType !~ m!^(text/html|text/plain|message|text$)!i;
        $last_content = $at->Content;
}

$html = HTML::TreeBuilder->new();
$html->parse($last_content);
$formatter = HTML::FormatText->new(leftmargin => 0, rightmargin => 50);
$formatter->format($html);

}

-- 
L.B.



More information about the rt-users mailing list