2014-01-28 37 views
0

我希望能夠發送電子郵件給以前的所有者,當有人竊取一張票,目前與請求跟蹤器我可以發送電子郵件給新的所有者,但不是以前所有者。請求跟蹤器:通知以前的所有者

似乎有一個擴展,讓這個不過它不支持RT 4.2(我用4.2.1):http://metacpan.org/pod/RT::Extension::NotifyOwners

任何幫助,將不勝感激,如果有人有此設置或使用在RT 4.2上的擴展會很棒。我非常肯定你可以通過自定義操作來做到這一點,但我對這方面的知識還不夠。從日誌

錯誤:

 
[email protected]:/home/steven# cpanm RT::Extension::NotifyOwners 
--> Working on RT::Extension::NotifyOwners 
Fetching http://www.cpan.org/authors/id/I/ID/IDN/RT-Extension-NotifyOwners-0.02.tar.gz ... OK 
Configuring RT-Extension-NotifyOwners-0.02 ... N/A 
! Configure failed for RT-Extension-NotifyOwners-0.02. See /root/.cpanm/work/1390880978.19447/build.log for details. 
[email protected]:/home/steven# tail /root/.cpanm/work/1390880978.19447/build.log 
Unpacking RT-Extension-NotifyOwners-0.02.tar.gz 
Entering RT-Extension-NotifyOwners-0.02 
Checking configure dependencies from META.yml 
Checking if you have ExtUtils::MakeMaker 6.42 ... Yes (6.82) 
Configuring RT-Extension-NotifyOwners-0.02 
Running Makefile.PL 
Cannot find the location of RT.pm that defines $RT::LocalPath in: inc /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/sh      are/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl . /opt/      rt3/lib /opt/lib/rt3 /opt/lib /usr/local/rt3/lib /usr/local/lib/rt3 /usr/local/lib /home/rt3/lib /home/lib/rt3 /home/lib      /usr/rt3/lib /usr/lib/rt3 /usr/lib /sw/rt3/lib /sw/lib/rt3 /sw/lib 
Path to directory containing your RT.pm: 
-> N/A 
-> FAIL Configure failed for RT-Extension-NotifyOwners-0.02. See /root/.cpanm/work/1390880978.19447/build.log for details. 
+0

你提到的擴展不支持RT 4.2。你試過了嗎?你看到了什麼錯誤或日誌消息? –

+0

用日誌編輯的帖子(鏈接到更易讀的格式:http://pastebin.com/r4g5NAS7) – MrWhippy

+0

它沒有找到你的RT安裝。嘗試將RTHOME環境變量設置爲RT基目錄,通常爲/ opt/rt4。 –

回答

0

您可以通過腳本和模板實現這一目標。以股代息On Steal Notify Old Owner應該是這樣的:

my $field = $self->TransactionObj->Field; 
my $type = $self->TransactionObj->Type; 

return 0 unless defined($field); 
return 0 unless $field eq 'Owner'; 
return 0 unless $type eq 'Set'; 
return 0 if $self->TransactionObj->OldValue == $self->TransactionObj->Creator; 

return 1 if $self->TransactionObj->OldValue != RT::Nobody()->id(); 

return 0; 

條件的紙條User defined行動應該Notify Other Recipients,例如Stolen Ticket模板

Perl的模板Stolen Ticket會再比如這一個:

To: {my $user = new RT::User($RT::SystemUser); 
$user->Load($Transaction->OldValue); $user->EmailAddress() || $Transaction->OldValue} 
Subject: [{$rtname } #{ $Ticket->Id() }] Stolen: { $Ticket->Subject() } 

URL: https://rt.example.com/rt/Ticket/Display.html?id={ $Ticket->id } 

A ticket you owned: 
    { $Ticket->Subject() } 

has been taken by {$Ticket->OwnerObj->RealName} <{$Ticket->OwnerObj->EmailAddress}>.