Override email headers

hey folks,

By default, RT doesn’t notify the Actor, so when this configuration set to 0 it send emails to CC parties yet cc parties cannot see who is the requester cause it will only fire cc, when i set NotifyActor to 1, it sends mails to both parties, so cc also can see the requester but actor also getting his own update, what i want to accomplish is i want the cc parties to see who is the requester without firing email to actor. how can i get this thing rolling?

scip: Correspond Notify Requestors and Ccs

Hello Dasun,
you can add a code to template for the mentioned scrip. Smething like:

Queue: {$Ticket->QueueObj->Name}
Requestors: {$Ticket->RequestorAddresses}
Ccs: {$Ticket->CcAddresses}
AdminCcs: {$Ticket->AdminCcAddresses}

If you don’t want to modify that notification this way, you can adapt your SendEmail.pm module, specifically the SetRTSpecialHeaders function. You can add there something like:

my $requestorAddresses = $self->TicketObj->RequestorAddresses;
if($requestorAddresses) {
$self->SetHeader( ‘X-RT-Requestors’, $requestorAddresses );
} else {
$self->SetHeader( ‘X-RT-Requestors’, ‘Nobody’ );
}

But to see this information you have to go to the mail source then.
Petr

Thank you Petr,

i tried to add mentioned code snippet to SendEmail.pm, but RT couldn’t load after that

sub SetRTSpecialHeaders {
    my $self = shift;
	

    $self->SetSubject();
    $self->SetSubjectToken();
    $self->SetHeaderAsEncoding( 'Subject',
        RT->Config->Get('EmailOutputEncoding') )
        if ( RT->Config->Get('EmailOutputEncoding') );
    $self->SetReturnAddress();
    $self->SetReferencesHeaders();

	my $requestorAddresses = $self->TicketObj->RequestorAddresses;
		if($requestorAddresses) {
			$self->SetHeader( ‘X-RT-Requestors’, $requestorAddresses );
			} else {
			$self->SetHeader( ‘X-RT-Requestors’, ‘Nobody’ );
			}

    unless ( $self->TemplateObj->MIMEObj->head->get('Message-ID') ) {

        # Get Message-ID for this txn
        my $msgid = "";
        if ( my $msg = $self->TransactionObj->Message->First ) {
            $msgid = $msg->GetHeader("RT-Message-ID")
                || $msg->GetHeader("Message-ID");
        }

        # If there is one, and we can parse it, then base our Message-ID on it
        if (    $msgid
            and $msgid
            =~ s/<(rt-.*?-\d+-\d+)\.(\d+)-\d+-\d+\@\QRT->Config->Get('Organization')\E>$/
                         "<$1." . $self->TicketObj->id
                          . "-" . $self->ScripObj->id
                          . "-" . $self->ScripActionObj->{_Message_ID}
                          . "@" . RT->Config->Get('Organization') . ">"/eg
            and $2 == $self->TicketObj->id
            )
        {
            $self->SetHeader( "Message-ID" => $msgid );
        } else {
            $self->SetHeader(
                'Message-ID' => RT::Interface::Email::GenMessageId(
                    Ticket      => $self->TicketObj,
                    Scrip       => $self->ScripObj,
                    ScripAction => $self->ScripActionObj
                ),
            );
        }
    }

    $self->SetHeader( 'X-RT-Loop-Prevention', RT->Config->Get('rtname') );

    $self->SetHeader( 'X-RT-Ticket',
        RT->Config->Get('rtname') . " #" . $self->TicketObj->id() );
    $self->SetHeader( 'X-Managed-by',
        "RT $RT::VERSION (http://www.bestpractical.com/rt/)" );

# 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
         and ! defined $self->TemplateObj->MIMEObj->head->get("RT-Originator")
         and RT->Config->Get('UseOriginatorHeader')
    ) {
        $self->SetHeader( 'X-RT-Originator', $email );

    }


}

Your code is inserted too upwards in the original code. Move it somewhere lower close to other “SetHeader” rows.