[rt-users] RecordOoutgoingEmailTransactions

Rolf Schaufelberger rs at plusw.de
Tue Mar 15 12:33:22 EST 2005


I want to add a special functionality to a ticket.

So I did the following steps:
- created a menu entry
- created a form in local/html/Ticket/.. 
- created Ticket_Local.pm with a method  say "myMethod"
- created a queue specific template. 
- created RT::Action::SendMyMethodEmail as subclass from SendEmail

Now everthing works fine except the logging of the outgoing email.
In Ticket/Display the entry shows up but clicking on [Show] gives me an error 
"Attachment couldn't be loaded"
The link looks like
  ".../ShowEmailRecord.html?id=8&Transaction=250&Attachment="

What I do in  myMethod is:

1. doing my special task (which works on another database )
2. create a transaction with $self->_NewTransaction
   This transaction is displayd in Ticket/Display.html
3. create a template obj with LoadQueueTemplate ...
4. create an action with 

=====
 my $notification = RT::Action::SendMyMethodEmail->new(
                                    TicketObj      => $self,
                                    TransactionObj => $TransObj,
                                    CurrentUser    => $self->CurrentUser,
                                    TemplateObj  => $template,
                                    Argument     => {value => $value,
                                                     pin => $pin },
                                         );

  my ($ret);
  $ret = $notification->Prepare();
  if ($ret) {
    $notification->SetHeader( 'To',$self->RequestorAddresses );
    $ret = $notification->Commit();
    ...   
   }	
=====

Now everything works, the email is sent with the template, all values filled 
in etc. 

My modifications in SendMyMethodEmail were removing everything where ScripObj 
is accessed since I have no ScripObj here.

So what am I doing wrong ?


Rolf Schaufelberger

-------------------------------------------------------------------
plusW
Dipl. Ing. Rolf Schaufelberger                 Tel. 07183/ 30 54 54
Stuttgarter Str. 26                            E-Mail: rs at plusw.de
73635 Rudersberg



More information about the rt-users mailing list