[rt-users] NotifyOwner and NotifyOwnerAsComment
Seth Cohn, EFN General Manager
gm at efn.org
Thu Jan 16 22:16:23 EST 2003
On Thu, 16 Jan 2003, Seth Cohn, EFN General Manager wrote:
Oops... missed a line in the cut and paste. Sorry about that.
Didn't notice it until I'd sent it off.
Correction:
$Transactions->OrderBy;
$Transactions->GotoFirstItem;
while (my $Transaction = $Transactions->Next) {
$this_transaction = $Transaction;
if (!$Transactions->IsLast) {
$this_transaction = undef;
}
Add the missing line as above.
Complete template again for those who want to cut and paste:
-----------------------------------------------------------
Subject: Ticket Reassigned: {$Ticket->Subject}
Greetings, this ticket is now yours.
----------------------------------------------------------------
--- The initial request was ------------------------------------
----------------------------------------------------------------
{$Ticket->Transactions->First->Content()}
----------------------------------------------------------------
--- Additional activity ----------------------------------------
----------------------------------------------------------------
{
my $this_transaction;
my $complete_message = "";
my $Transactions = $Ticket->Transactions;
$Transactions->OrderBy;
$Transactions->GotoFirstItem;
while (my $Transaction = $Transactions->Next) {
$this_transaction = $Transaction;
if (!$Transactions->IsLast) {
$this_transaction = undef;
}
if ($this_transaction) {
my $attachments = $this_transaction->Attachments;
$attachments->GotoFirstItem;
while (my $message = $attachments->Next) {
next unless $message->ContentType =~
m!^(text/plain|message|text$)!i;
my $content = $message->Content;
next unless length $content;
my $subject = ($message->Subject || $Ticket->Subject);
my $wrapper = Text::Wrapper->new(columns=>70);
$content = $wrapper->wrap($content);
$complete_message .= "Subject: ";
$complete_message .= $subject;
$complete_message .= "\n";
$complete_message .= "From: ";
$complete_message .= $message->CreatorObj->RealName;
$complete_message .= "\n";
$complete_message .= "Time: ";
$complete_message .= $message->CreatedObj->AsString;
$complete_message .= "\n";
$complete_message .= "\n";
$complete_message .= "$content\n";
$complete_message .= "--------------------------\n";
}
}
}
$complete_message;
}
More information about the rt-users
mailing list