[rt-devel] Notify somebody only once if they are a CC and a requestor.

Dan Wright wright at smx.pair.com
Mon Nov 10 15:52:22 EST 2003


I've noticed if a person is a queue watcher, and is the creator of a ticket,
they end up getting two copies of each mail (Once as a "To:", and Once as a
"Cc:")

This patch in RT::Action::Notify::SetRecipients() seems to fix that for me.
Maybe somebody else will also find it useful:



    my $creator = $self->TransactionObj->CreatorObj->EmailAddress();

+    #Let each recipient be listed only once!
+    my %seen;
+    @To = grep { ! $seen{$_}++ } @To;
+    @Cc = grep { ! $seen{$_}++ } @Cc;
+    @Bcc = grep { ! $seen{$_}++ } @Bcc;

    #Strip the sender out of the To, Cc and AdminCc and set the
    # recipients fields used to build the message by the superclass.
    # unless a flag is set




More information about the Rt-devel mailing list