I’m trying to write a scrip that will add a user as a 2nd requestor to
any email that comes in from a particular domain.
So I have:
Condition: On Create
Action: User Defined
Template: Global Blank
Stage: TransactionCreate
In preparation code I have:
my $requestor_address = $self->TicketObj->RequestorAddresses;
my $domain = “domain.com”;
If the user is from domain.com but NOT the manager, do the magic.
if ( $requestor_address =~ /$domain/i && $requestor_address !~
/‘manager@domain.com’/i )
{
return 1;
}
else {
return 0;
}
In action cleanup code I have:
my $Reqlist = $self->TicketObj->Requestor;
my $user = RT::User->new($RT::SystemUser);
$user->LoadByEmail(‘manager@domain.com’);
$Reqlist->AddMember($user->Id);
But it doesn’t work. What I am missing? What am I doing wrong? If
this works, will it also send an e-mail to the manager?
Basically, any request from this email domain, I want the manager to be
able to view, control, add, and stay in the loop. Is there an easier
way to do this for a non-priviledge user?
M.