Prevent AdminCC to get emails twice with NotifyActor=1

Hello,

we are running RT 3.6.3. Our users prefer have NotifyActor set to 1.
But we now have the
problem that AdminCc receive emails twice now when a ticket is updated
which they
have created themselves. How can we prevent this from happening?

Many thanks in advance

Dorothea

Dorothea,

That's the very reason RT came up with turning OFF the actor. I don't 

think they can have it both ways. If they are doing the transaction,
then they already KNOW they did it and RT STILL keeps the trans in
history. You might have to write a scrip that examines the creator and
compares it to the AdminCC on certain transaction types and turn it off
for that actor or role. Kind of a messy way to stop a redundant email
when RT already offers that by turning of NotifyActor.

Kenn
LBNLOn 10/20/2008 1:40 AM, Dorothea Muecke-Herzberg wrote:

Hello,

we are running RT 3.6.3. Our users prefer have NotifyActor set to 1.
But we now have the
problem that AdminCc receive emails twice now when a ticket is updated
which they
have created themselves. How can we prevent this from happening?

Many thanks in advance

Dorothea


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Dorothea,

That’s the very reason RT came up with turning OFF the actor. I don’t
think they can have it both ways. If they are doing the transaction,
then they already KNOW they did it and RT STILL keeps the trans in
history. You might have to write a scrip that examines the creator and
compares it to the AdminCC on certain transaction types and turn it off
for that actor or role. Kind of a messy way to stop a redundant email
when RT already offers that by turning of NotifyActor.

Kenn
LBNL

I believe the NotifyActor is to prevent people getting copies of their own
updates, not to avoid duplicate messages.

Dorothea - I’m guessing, but you probably have scrips like this:

On Correspond Notify Requestors …
On Correspond Notify AdminCcs …

And when the requestor is the person adding a reply, both scrips send
mail. You could try just having one scrip for replies, for example:

On Correspond Notify Requestors, Ccs, AdminCcs, and Other Recipients …

You’ll need to insert into the ScripActions table to make this action
available in the web interface. You lose the ability to have different
templates for Requestors and AdminCcs, but that might be OK for you.

Steve> On 10/20/2008 1:40 AM, Dorothea Muecke-Herzberg wrote:

Hello,

we are running RT 3.6.3. Our users prefer have NotifyActor set to 1.
But we now have the
problem that AdminCc receive emails twice now when a ticket is updated
which they
have created themselves. How can we prevent this from happening?

Many thanks in advance

Dorothea
Stephen Turner
Senior Programmer/Analyst - SAIS
MIT IS&T

Thank you for your responses. I also understood that NotifyActor is to
prevent people
getting copies of their own updates. So, after some digging, I went
and changed Notify.pm
to handle duplicate emails and it seems to be working fine (sorry,
it’s longwinded, but my perl is
rudimentary). It checks whether creator is already in the AdminCc, Cc
or Requestors email
addresses and also whether there are duplicates between AdminCc&Cc,
AdminCc&Requestor
and Cc&Requestor:

my @adminscc = $self->TicketObj->QueueObj->AdminCc->MemberEmailAddresses;
my @ceecees = $self->TicketObj->Cc->MemberEmailAddresses;
my @requestees = $self->TicketObj->Requestors->MemberEmailAddresses;

based on creator

my $in_admincc = 0;
foreach my $admin_address ( @adminscc ) {
     $in_admincc = 1 if ( lc($creator) eq lc($admin_address) );
}
my $in_cc = 0;
foreach my $cc_address ( @ceecees ) {
     $in_cc = 1 if ( lc($creator) eq lc($cc_address) );
}
## based on requestor and AdminCC (most common case)
foreach my $to_address ( @requestees ) {
    foreach my $admin_address ( @adminscc ) {
        if ( lc($to_address) eq lc($admin_address) ) {
            $RT::Logger->info( "BeforeDuplicate address in

Requestors and AdminCC $to_address");
@{ $self->{‘To’} } = @To = grep ( lc $_ ne lc
$to_address, @To );
@{ $self->{‘Cc’} } = @Cc;
@{ $self->{‘Bcc’} } = @Bcc;
$RT::Logger->info( “After Duplicate address in
Requestors and AdminCC - $to_address removed from list:
‘@{$self->{‘To’}}’”);
}
}
}
## based on requestor and CC
foreach my $to_address ( @requestees ) {
foreach my $cc_address ( @ceecees ) {
if ( lc($to_address) eq lc($cc_address) ) {
@{ $self->{‘To’} } = @To = grep ( lc $_ ne lc
$to_address, @To );
@{ $self->{‘Cc’} } = @Cc;
@{ $self->{‘Bcc’} } = @Bcc;
$RT::Logger->info( “Duplicate address in Requestors
and CC - $to_address removed from list: ‘@{$self->{‘To’}}’”);
}
}
}
## based on Cc and AdminCc
foreach my $cc_address ( @ceecees ) {
foreach my $admin_address ( @adminscc ) {
if ( lc($cc_address) eq lc($admin_address) ) {
@{ $self->{‘To’} } = @To;
@{ $self->{‘Cc’} } = @Cc = grep ( lc $_ ne lc
$cc_address, @Cc );
@{ $self->{‘Bcc’} } = @Bcc;
$RT::Logger->info( “Duplicate address in CC and
AdminCC - $cc_address removed from list: ‘@{ $self->{‘Cc’} }’”);
}
}
}
## Now handle duplicates based on creator:
if ( $RT::NotifyActor ) {
# if creator not in AdminCC or CC, send as is; do not strip
creator from To, Cc or AdminCC
if ( !$in_admincc && !$in_cc ) {
@{ $self->{‘To’} } = @To;
@{ $self->{‘Cc’} } = @Cc;
@{ $self->{‘Bcc’} } = @Bcc;
}
# if creator is in Cc, but not in AdminCC, strip creator from
To and AdminCc
if ( !$in_admincc && $in_cc ) {
@{ $self->{‘To’} } = grep ( lc $_ ne lc $creator, @To );
@{ $self->{‘Cc’} } = @Cc;
@{ $self->{‘Bcc’} } = grep ( lc $_ ne lc $creator, @Bcc );
}
# if creator is in AdminCc, but not in CC, strip creator from
To and AdminCc
if ( $in_admincc && !$in_cc ) {
@{ $self->{‘To’} } = grep ( lc $_ ne lc $creator, @To );
@{ $self->{‘Cc’} } = grep ( lc $_ ne lc $creator, @Cc );
@{ $self->{‘Bcc’} } = @Bcc;
}
# if creator is in Cc and AdminCC, strip creator from To and Cc
(only send to AdminCc)
if ( $in_admincc && $in_cc ) {
@{ $self->{‘To’} } = grep ( lc $_ ne lc $creator, @To );
@{ $self->{‘Cc’} } = grep ( lc $_ ne lc $creator, @Cc );
@{ $self->{‘Bcc’} } = @Bcc;
}
# in case we have forgotten something, default is not to strip anything
else {
@{ $self->{‘To’} } = @To;
@{ $self->{‘Cc’} } = @Cc;
@{ $self->{‘Bcc’} } = @Bcc;
}
}
else {
@{ $self->{‘To’} } = grep ( lc $_ ne lc $creator, @To );
@{ $self->{‘Cc’} } = grep ( lc $_ ne lc $creator, @Cc );
@{ $self->{‘Bcc’} } = grep ( lc $_ ne lc $creator, @Bcc );
}

@{ $self->{'PseudoTo'} } = @PseudoTo;

}

Dorothea