[rt-devel] Make the "From:" line show the sender's address instead of the queue's address.

Jesse Vincent jesse at bestpractical.com
Mon Nov 10 16:09:39 EST 2003


You can simply drop that logic into your templates. It'll override the
defaults.


On Mon, Nov 10, 2003 at 04:00:53PM -0500, Dan Wright wrote:
> 
>   For our RT installation, we decided that when RT sends out copies of
> correspondences to ticket Requesters and Cc's, that we'd rather have the email
> address of the Requester be listed in the "From:" field of the email, than the
> address of the queue.  We use the "Reply-To:" field to list the address of the
> requester.
> 
>   Perhaps this could be a configurable option in a future release of RT?
> 
>   Here is the source code that shows our modifications in case anybody is
> interested:
> 
> 
> 
> package RT::Action::SendEmail_Local;
> 
> sub SetReturnAddress {
> 
>     my $self = shift;
>     my %args = ( is_comment => 0,
>                  @_ );
> 
>     # From and Reply-To
>     # $args{is_comment} should be set if the comment address is to be used.
>     my $replyto;
> 
>     if ( $args{'is_comment'} ) {
>         $replyto = $self->TicketObj->QueueObj->CommentAddress
>           || $RT::CommentAddress;
>     }
>     else {
>         $replyto = $self->TicketObj->QueueObj->CorrespondAddress
>           || $RT::CorrespondAddress;
>     }
> 
>     unless ( $self->TemplateObj->MIMEObj->head->get('From') ) {
>         if ($RT::UseFriendlyFromLine) {
>             my $friendly_name = $self->TransactionObj->CreatorObj->RealName;
>             if ( $friendly_name =~ /^"(.*)"$/ ) {    # a quoted string
>                 $friendly_name = $1;
>             }
> 
>         my $sender_address =  $self->TransactionObj->CreatorObj->EmailAddress;
> 
>             $friendly_name =~ s/"/\\"/g;
>             $self->SetHeader( 'From',
>                         sprintf($RT::FriendlyFromLineFormat,
>                 $self->MIMEEncodeString( $friendly_name,
> $RT::EmailOutputEncoding ), $sender_address),
>             );
>         }
>         else {
>             $self->SetHeader( 'From', $replyto );
>         }
>     }
> 
>     unless ( $self->TemplateObj->MIMEObj->head->get('Reply-To') ) {
>         $self->SetHeader( 'Reply-To', "$replyto" );
>     }
> 
> }
> 
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-devel
> 

-- 
http://www.bestpractical.com/rt  -- Trouble Ticketing. Free.



More information about the Rt-devel mailing list