[rt-users] Editing From:

Mauricio Tavares raubvogel at gmail.com
Tue Oct 27 13:43:25 EDT 2009


	I have been asked to change out RT install such that when someone in, 
say, the support group replies, his RealName is not shown ("Support 
Staff at support at domain.com" is used instead). Otherwise, the From: 
header should look like the default one ("Joe Cool via RT"). Has anyone 
done that? Looking at the code, I imagine that the one I want is 
somewhere in SendEmail.pm,

     unless ( $self->TemplateObj->MIMEObj->head->get('From') ) {
         if ($RT::UseFriendlyFromLine) {
             my $friendly_name = $self->TransactionObj->CreatorObj->RealName
                 || $self->TransactionObj->CreatorObj->Name;
             if ( $friendly_name =~ /^"(.*)"$/ ) {    # a quoted string
                 $friendly_name = $1;
             }

             $friendly_name =~ s/"/\\"/g;
             $self->SetHeader(
                 'From',
                 sprintf(
                     $RT::FriendlyFromLineFormat,
                     $self->MIMEEncodeString( $friendly_name,
                         $RT::EmailOutputEncoding ),
                     $replyto
                 ),
             );
         }
         else {
             $self->SetHeader( 'From', $replyto );
         }

but that feels like I would be hardcoding it here, which is not a long 
term solution. Are there better ways to do it?

Also, using my own example, the default From: header looks something 
like "Joe Cool via RT." How do I replace the "RT" with another string?



More information about the rt-users mailing list