OnCreateFromEmail

From Request Tracker Wiki
Revision as of 14:13, 13 August 2016 by Tharn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

We wanted to be able to send out autoreply emails only when a ticket is created by the end user sending an email. Emails are not sent when a ticket is created by an agent through the web interface.

This scrip is based on OnWebCorrespond and has been tested with RT 3.6.0.

 # Custom condition to autoreply only when a ticket is created via email
 # Written by Rob Lemley <rob@slide.com> 2006-08-09
 # Based on "OnWebCorrespond"
 # http://wiki.bestpractical.com/index.cgi?OnWebCorrespond
 
 my $trans = $self->TransactionObj;
 
 return 0 unless $trans->Type eq "Create";
 
 my $msgattr = $trans->Message->First;
 
 return 0 unless $msgattr;
 
 return 1 if $msgattr->GetHeader('Received');
 
 return 0;
 
 

See also AnyTransactionSource