Contrib: GiveHistory template Re: [rt-users] NotifyOwner and NotifyOwnerAsComment
Rafael Maximo
maximo at empresa.com
Fri Jan 17 06:22:24 EST 2003
Thank you a lot, it worked just great, exactly what I wanted.
Thanks for your help.
bye.
At 01:26 AM 17/1/2003, you wrote:
>One MORE correction. Bleh.
>
>I'd modified this template and halfway tested it, but didn't notice that
>I'd goofed. The original version of this template was for resolved
>tickets, and was sent to the end user, so it stripped out everything but
>correspondence. This version was for sending to the new owner, so I wanted
>comments sent. But I messed up the if/elsif lines, and never noticed
>that. Please excuse my error(s).
>
>Use the following, which works, which I've tested fully now.
>I'd love to see the code that would process the non-message transactions
>properly, if anyone does take the time to write that.
>
>-------------------------
>Subject: Ticket Reassigned: {$Ticket->Subject}
>
>Greetings, this ticket is now yours.
>
> Queue: {$Ticket->QueueObj->Name}
> Requestors: {$Ticket->Requestors->EmailsAsString()}
> Status: {$Ticket->Status}
> Ticket <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
>
>----------------------------------------------------------------
>--- 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 ($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;
>
>}
>
>
>
>
>
>_______________________________________________
>rt-users mailing list
>rt-users at lists.fsck.com
>http://lists.fsck.com/mailman/listinfo/rt-users
>
>Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
Rafael Máximo
More information about the rt-users
mailing list