diff options
Diffstat (limited to 'rt/lib/RT/Action')
-rwxr-xr-x | rt/lib/RT/Action/Notify.pm | 7 | ||||
-rwxr-xr-x | rt/lib/RT/Action/NotifyAsComment.pm | 19 | ||||
-rw-r--r-- | rt/lib/RT/Action/NotifyGroup.pm | 9 | ||||
-rwxr-xr-x | rt/lib/RT/Action/SendEmail.pm | 11 |
4 files changed, 29 insertions, 17 deletions
diff --git a/rt/lib/RT/Action/Notify.pm b/rt/lib/RT/Action/Notify.pm index 30238fd61..3b782f34b 100755 --- a/rt/lib/RT/Action/Notify.pm +++ b/rt/lib/RT/Action/Notify.pm @@ -139,12 +139,15 @@ sub SetRecipients { } } - my $creator = $self->TransactionObj->CreatorObj->EmailAddress(); + my $creatorObj = $self->TransactionObj->CreatorObj; + my $creator = $creatorObj->EmailAddress(); #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 - if (RT->Config->Get('NotifyActor')) { + my $TransactionCurrentUser = RT::CurrentUser->new; + $TransactionCurrentUser->LoadByName($creatorObj->Name); + if (RT->Config->Get('NotifyActor',$TransactionCurrentUser)) { @{ $self->{'To'} } = @To; @{ $self->{'Cc'} } = @Cc; @{ $self->{'Bcc'} } = @Bcc; diff --git a/rt/lib/RT/Action/NotifyAsComment.pm b/rt/lib/RT/Action/NotifyAsComment.pm index b2eb5acd8..4380c86db 100755 --- a/rt/lib/RT/Action/NotifyAsComment.pm +++ b/rt/lib/RT/Action/NotifyAsComment.pm @@ -47,27 +47,27 @@ # END BPS TAGGED BLOCK }}} package RT::Action::NotifyAsComment; -require RT::Action::Notify; use strict; use warnings; + use base qw(RT::Action::Notify); =head2 SetReturnAddress -Tell SendEmail that this message should come out as a comment. +Tell SendEmail that this message should come out as a comment. Calls SUPER::SetReturnAddress. =cut sub SetReturnAddress { - my $self = shift; - - # Tell RT::Action::SendEmail that this should come - # from the relevant comment email address. - $self->{'comment'} = 1; - - return($self->SUPER::SetReturnAddress(is_comment => 1)); + my $self = shift; + + # Tell RT::Action::SendEmail that this should come + # from the relevant comment email address. + $self->{'comment'} = 1; + + return $self->SUPER::SetReturnAddress( @_, is_comment => 1 ); } eval "require RT::Action::NotifyAsComment_Vendor"; @@ -76,4 +76,3 @@ eval "require RT::Action::NotifyAsComment_Local"; die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyAsComment_Local.pm}); 1; - diff --git a/rt/lib/RT/Action/NotifyGroup.pm b/rt/lib/RT/Action/NotifyGroup.pm index 6b830cb86..131c583d9 100644 --- a/rt/lib/RT/Action/NotifyGroup.pm +++ b/rt/lib/RT/Action/NotifyGroup.pm @@ -84,8 +84,13 @@ sub SetRecipients { $self->_HandleArgument( $_ ); } - my $creator = $self->TransactionObj->CreatorObj->EmailAddress(); - unless( $RT::NotifyActor ) { + my $creatorObj = $self->TransactionObj->CreatorObj; + my $creator = $creatorObj->EmailAddress(); + + my $TransactionCurrentUser = RT::CurrentUser->new; + $TransactionCurrentUser->LoadByName($creatorObj->Name); + + unless (RT->Config->Get('NotifyActor',$TransactionCurrentUser)) { @{ $self->{'To'} } = grep ( !/^\Q$creator\E$/, @{ $self->{'To'} } ); } diff --git a/rt/lib/RT/Action/SendEmail.pm b/rt/lib/RT/Action/SendEmail.pm index a09bd3e56..8b682c118 100755 --- a/rt/lib/RT/Action/SendEmail.pm +++ b/rt/lib/RT/Action/SendEmail.pm @@ -607,8 +607,11 @@ sub SetRTSpecialHeaders { } } - $self->SetHeader( 'Precedence', "bulk" ) - unless ( $self->TemplateObj->MIMEObj->head->get("Precedence") ); + if (my $precedence = RT->Config->Get('DefaultMailPrecedence') + and !$self->TemplateObj->MIMEObj->head->get("Precedence") + ) { + $self->SetHeader( 'Precedence', $precedence ); + } $self->SetHeader( 'X-RT-Loop-Prevention', RT->Config->Get('rtname') ); $self->SetHeader( 'RT-Ticket', @@ -618,7 +621,9 @@ sub SetRTSpecialHeaders { # XXX, TODO: use /ShowUser/ShowUserEntry(or something like that) when it would be # refactored into user's method. - if ( my $email = $self->TransactionObj->CreatorObj->EmailAddress ) { + if ( my $email = $self->TransactionObj->CreatorObj->EmailAddress + and RT->Config->Get('UseOriginatorHeader') + ) { $self->SetHeader( 'RT-Originator', $email ); } |