NotifyOwnerOrQueueAdminCcs: Initial Scrip action.

This commit is contained in:
Brett Smith 2018-04-10 11:30:54 -04:00
parent 50e684e755
commit 50db9059bd
3 changed files with 32 additions and 1 deletions

8
etc/upgrade/0.2/content Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/env perl
@ScripActions = (
{ Name => 'Notify Owner or Queue AdminCcs',
Description => 'Sends mail to ticket AdminCCs, plus the Owner if set, otherwise queue AdminCCs',
ExecModule => 'NotifyOwnerOrQueueAdminCcs',
},
);

View file

@ -0,0 +1,23 @@
package RT::Action::NotifyOwnerOrQueueAdminCcs;
use strict;
use warnings;
use base qw(RT::Action::NotifyOwnerOrAdminCc);
sub SetRecipients {
my $self = shift;
$self->SUPER::SetRecipients();
my $ticket = $self->TicketObj;
# If the ticket has an owner, that person was set as the recipient.
# Now add ticket AdminCcs to the Bcc list.
if ($ticket->Owner != RT->Nobody->id) {
push(@{$self->{Bcc}}, $ticket->AdminCc->MemberEmailAddresses);
}
# If the ticket has no owner, both queue and ticket AdminCCs were set as
# recipients. There's nothing else to do.
}
RT::Base->_ImportOverlays();
1;

View file

@ -7,6 +7,6 @@ use strict;
use warnings;
package RT::Extension::Conservancy;
our $VERSION = '0.1';
our $VERSION = '0.2';
1;