[Rt-devel] Help: Scrip to send emails to an address if CF.{distro} = 'public'

Raed El-Hames Raed.El-Hames at daisygroupplc.com
Wed Jan 19 07:37:47 EST 2011


Riccardo:

You will need to create a new global template with
To: public.foo at example.com  at the very top

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

Regards;
Roy

> -----Original Message-----
> From: rt-devel-bounces at lists.bestpractical.com [mailto:rt-devel-
> bounces at lists.bestpractical.com] On Behalf Of Riccardo Carlesso
> Sent: 19 January 2011 12:29
> To: rt-devel at lists.bestpractical.com
> Subject: [Rt-devel] Help: Scrip to send emails to an address if
> CF.{distro} = 'public'
> 
> Hi,
> we need to implement a functionality that allows to send a FooTemplate
> to a well-known email address ('public.foo at example.com') on every
> Open/Reply/Close of a ticket if a 'distribution' CustomField is set to
> 'public'.
> 
> I implemented the ScripCondition in the
> local/RT/Condition/OnHeanetPublicTicket.pm (see below for the code: Im
> still missing the part that checks for open/reply/close and ignores
> comments)
> 
> The tricky part comes now.
> 
> I dont seem to be able to implement a ScripAction to send an
> 'additional' email to 'public.foo at example.com'. 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
> email.
> 
> 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,
>    Riccardo
> 
> 
> ----- code for ScripCondition on
> 'local/RT/Condition/OnHeanetPublicTicket.pm' --------
> 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: http://www.heanet.ie/  PGP: 4096R/772F54DE
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-
> devel


More information about the rt-devel mailing list