Help: Scrip to send emails to an address if CF.{distro} = 'public'

we need to implement a functionality that allows to send a FooTemplate
to a well-known email address (‘’) on every
Open/Reply/Close of a ticket if a ‘distribution’ CustomField is set to

I implemented the ScripCondition in the
local/RT/Condition/ (see below for the code: Im
still missing the part that checks for open/reply/close and ignores

The tricky part comes now.

I dont seem to be able to implement a ScripAction to send an
’additional’ email to ‘’. A lot of SendMail magic
is in RT, according to the logs. For instance, it checks for
Tos/Ccs/Bccs from many parts and depending on this it sends (or not) an

I see there’s a ScripAction called SendEmail. Can I create a
HeanetSendPublicEmail action the calls the ‘SendEmail’ action with ONLY
my custom ‘To’ field and ignoring other Ccs and Bccs? Or maybe use a
Notify action with SetRecipients? Can anyone point me to some URL
resource for implementing an Action myself?

If this CF need was a Queue by itself (but we want this behaviour to be
trasversal to ALL queues…), it would be easy by putting that email in
Cc/AdminCc, I assume.

Thanks a lot,

----- code for ScripCondition on
’local/RT/Condition/’ --------
sub isApplicable {
my $self = shift;

my $Ticket = $self->TicketObj;
my $distro = $Ticket->FirstCustomFieldValue('Distribution');
my $ret = ($Ticket->FirstCustomFieldValue('Distribution') eq 'public') ;
my $subject = $Ticket->Subject();
return $ret ;


Riccardo Carlesso

HEAnet Limited, Ireland’s Education and Research Network
1st Floor, 5 George’s Dock, IFSC, Dublin 1
Registered in Ireland, no 275301
Tel: +353-1-660 9040 Fax: +353-1-660 3666
Web: PGP: 4096R/772F54DE


You will need to create a new global template with

Then leave at least 2 lines and add the template content.
Your scrip action should be NotifyOtherRecipients
And select the template you created.