RT-Extension-LinkableActions - Create clickable links in emails that when clicked perform an action in RT.
Like RT::Scrips that fire on click.
Works with RT 5.0
perl Makefile.PL
make
make install
May need root permissions
Add this line:
Plugin('RT::Extension::LinkableActions');
rm -rf /opt/rt4/var/mason_data/obj
This extension uses a custom method call from templates to generate a link that will perform a action on click. This method needs to be provided with the $Ticket and $Transaction objects from the template. You then pass a string of the code you want executed. The example template below has a linked action that will resolve the ticket:
Subject: {$Ticket->Subject}
Content-Type: text/html
{
my $sub = q {
my ($ret, $msg) = $Ticket->SetStatus('resolved');
RT::Logger->error($msg) unless $ret;
};
$OUT = RT::Extension::LinkableActions->NewLinkAction(
Ticket => $Ticket,
Transaction => $Transaction,
Sub => $sub,
Name => 'Issue is resolved',
NoAuth => 0
);
}
Where the "Name" key will be the name displayed as the text content of the resulting anchor tag.
WARNING Adding the NoAuth
flag means that anyone can execute
action as the RT->SystemUser.
-
Clean-up template method call
-
Add a
CompileCheck
call on template update to check if code is valid in $sub.
Craig Kaiser