Hi Marie,

 

there was an acrticle on the wiki: http://wiki.bestpractical.com/index.cgi?AddTicketHistoryToMail

 

but it is removed from dumb spammers.

 

Here is a copy:

 

AddTicketHistoryToMail

 

 

Original author: Michael Markstaller - IFCO

 

Code cleanups: RuslanZakirov

 

Require: Text::Wrapper perl module

 

Subject: Resolved: {$Ticket->Subject}

 

Dear customer,

 

your issue regarding

 

       "{$Ticket->Subject()}",

 

has been resolved in our ticket system. See below for history of this ticket.

 

If you have any further questions or concerns, please reply to this

message to reopen the ticket.

 

regards

 

{$Ticket->OwnerObj->RealName || $Ticket->OwnerObj->Name}

your-company-fooprint

 

----------------------------------------------------------------

  Your initial request was

----------------------------------------------------------------

 

{$Ticket->Transactions->First->Content()}

 

----------------------------------------------------------------

  Complete Ticket History

----------------------------------------------------------------

 

{

 my $resolved_message = '';

 my $last_content = '';

 

 my $transactions = $Ticket->Transactions;

 $transactions->Limit( FIELD => 'Type', VALUE => 'Correspond' );

 

 while (my $transaction = $transactions->Next) {

   my $attachments = $transaction->Attachments;

 

   while (my $message = $attachments->Next) {

     next unless $message->ContentType =~

              m!^(text/plain|message|text$)!i;

 

     my $content = $message->Content;

     next unless $content;

 

     next if $last_content eq $content;

     $last_content = $content;

 

     my $subject = ($message->Subject || $Ticket->Subject);

 

     my $wrapper = Text::Wrapper->new(columns=>70);

     $content = $wrapper->wrap($content);

 

     $resolved_message .= "Subject: ";

     $resolved_message .= $subject;

     $resolved_message .= "\n";

     $resolved_message .= "From: ";

     $resolved_message .= $message->CreatorObj->RealName || $message->CreatorObj->EmailAddress;

     $resolved_message .= "\n";

     $resolved_message .= "Time: ";

     $resolved_message .= $message->CreatedObj->AsString;

     $resolved_message .= "\n";

     $resolved_message .= "\n";

     $resolved_message .= "$content\n";

     $resolved_message .= "------------------------------------------------\n";

   }

 }

 $resolved_message;

}

 

-------------------------------------------------------------------------

   Common Information

-------------------------------------------------------------------------

 

There is no need to reply to this message unless you want to RE-OPEN your

ticket with ID [{$rtname} #{$Ticket->id}].

 

If you want to simply add a COMMENT to this ticket whithout re-opening the ticket, click below:

mailto:[EMAIL PROTECTED]>id()}]&body=%20

 

Please note:

- ALWAYS include the string [{$rtname} #{$Ticket->id}] in the subject line of all future correspondence about this issue.

- Do NOT attach or include the content of previous emails already sent to you by rt.

 

 


Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Marie Gellbäck
Gesendet: Dienstag, 11. Juli 2006 09:52
An: [email protected]
Betreff: [rt-users] Ticket history in ticket resolved message

 

Hello,

 

I’m using RT 3.4.

I would like to include the initial ticket question in the message that is sent to the requestor when his ticket has been resolved. The problem is that I don’t want to use an OnResolved template because that would generate two emails to the requestor (template message + resolve message). So what I want to do is to add $Ticket->Transactions->First->Content() to the message area on the Update.html page. But the message area is included (Elements/MessageBox) so if I add the ticket history text to the MessageBox all message boxes will display the ticket history.

There is an argument, UpdateContent, defined in Update.html that is passed on to the MessageBox, does anyone know if/how I can add my ticket history text to that argument?

 

I have searched the wiki and the mailing list but I can’t find any similar problems, but maybe I’m looking for a bad solution. Any tips or hints in the correct direction would be appreciated.

 

Best regards

 

Marie Gellbäck

Developer

 

_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


We're hiring! Come hack Perl for Best Practical: 
http://bestpractical.com/about/jobs.html

Reply via email to