OnWebCorrespond

From Request Tracker Wiki
Jump to navigation Jump to search

Question - in an OnCorrespond scrip, how can you determine if the reply is from an incoming email message or from the web interface?

Here's a custom scrip condition that checks for a "Received" header in the message - if there is one, we assume we're dealing with email. If not, it's a reply entered in the web interface.

This code will cause the scrip to proceed if we're dealing with a web interface reply.

my $trans = $self->TransactionObj;
 
 # OnCorrespond:
 return 0 unless $trans->Type eq "Correspond";
 
 # Get the message attachment
 my $msgattr = $trans->Message->First;
 
 return 1 unless $msgattr; # no message attachment - assume web UI
 
 return 0 if $msgattr->GetHeader('Received'); # email message
 
 return 1;
 
 

Steve Turner 5/19/05

See also AnyTransactionSource.