#If the watcher we're trying to add is for the current user
if ( $self->CurrentUser->PrincipalId == ($args{'PrincipalId'} || 0)
or lc( $self->CurrentUser->UserObj->EmailAddress )
- eq lc( RT::User::CanonicalizeEmailAddress(undef, $args{'Email'}) || '' ) )
+ eq lc( RT::User->CanonicalizeEmailAddress( $args{'Email'} ) || '' ) )
{
# If it's an AdminCc and they don't have
# 'WatchAsAdminCc' or 'ModifyTicket', bail
# The "NotifyOtherRecipients" scripAction will look for RT-Send-Cc: and RT-Send-Bcc:
# headers
- $args{'MIMEObj'}->head->add( 'RT-Send-Cc', RT::User::CanonicalizeEmailAddress(
- undef, $args{'CcMessageTo'}
- ) )
- if defined $args{'CcMessageTo'};
- $args{'MIMEObj'}->head->add( 'RT-Send-Bcc',
- RT::User::CanonicalizeEmailAddress(
- undef, $args{'BccMessageTo'}
- ) )
- if defined $args{'BccMessageTo'};
+
+ foreach my $type (qw/Cc Bcc/) {
+ if ( defined $args{ $type . 'MessageTo' } ) {
+
+ my $addresses = join ', ', (
+ map { RT::User->CanonicalizeEmailAddress( $_->address ) }
+ Mail::Address->parse( $args{ $type . 'MessageTo' } ) );
+ $args{'MIMEObj'}->head->add( 'RT-Send-' . $type, $addresses );
+ }
+ }
# If this is from an external source, we need to come up with its
# internal Message-ID now, so all emails sent because of this