[rt-users] problem with custom condition in scrip

Hugo Escobar hescobar at afslc.com
Fri May 23 11:00:19 EDT 2014


Right, I wasn't getting the email address. it works now.
Thanks


On Thu, May 22, 2014 at 4:35 PM, Kevin Falcone <falcone at bestpractical.com>wrote:

> On Wed, May 21, 2014 at 10:12:03PM -0400, Hugo Escobar wrote:
> > Hello,
> >
> > I've been attempting to instruct rt to send emails 'On Correspond' to
> > 'Requestors' and 'Ccs',
> > only if the email address of the user generating the transaction matches
> a
> > predetermined list (@domain1 or @domain2)
> >
> > Following, the code I wrote for the 'custom condition':
> >
> > #--- begin code ---
> > if ( $self->TransactionObj->Type ne 'Create'
> >         &&
> >     !grep { $self->CurrentUser->EmailAddress =~ /$_$/ }
> >            ('@domain1','@domain2')
> > ) {
> >     return 0;
> > }
> >
> > return 1;
>
> RT->Logger->error($self->CurrentUser->EmailAddress); to see what the
> email address is.  It isn't who you think it is.  You want
> $self->TransactionObj->CreatorObj->EmailAddress
>
> Your check of ne 'Create' is also sort of non-sensical since it'll
> apply to transactions such as setting a status or changing a CF.
>
> -kevin
>
> --
> RT Training - Boston, September 9-10
> http://bestpractical.com/training
>



-- 
Hugo Escobar


[image: AFS_logo.png]

Follow us on Facebook and Linked-In

[image: facebook-24x24.png]<http://www.facebook.com/pages/Miami-FL/ASSOCIATION-FINANCIAL/64952991864>
 [image: linkedin-24x24.png] <http://www.linkedin.com/companies/1006276>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140523/edad326a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linkedin-24x24.png
Type: image/png
Size: 875 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140523/edad326a/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: facebook-24x24.png
Type: image/png
Size: 814 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140523/edad326a/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AFS_logo.png
Type: image/png
Size: 3183 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140523/edad326a/attachment-0002.png>


More information about the rt-users mailing list