Set the FriendlyName on outgoing mail from system

We use the setting $UseFriendlyFromLine=1 (default) to get “SenderName via RT”.
If an agent causes a transaction RT calculates the proper Friendly Name based on the creator of the transaction. Works fine.

Our problem is the Friendly Name used in the AutoReply on ticket-creation. See code below.
The queue-descriptions are used to describe the queues. They are somehow speaking and quite well to guide the customer using SelfService. But they are not really usable as Friendly Name.

Example:

  • Support for office-software and and remote access systems
  • Questions regarding finacial issues

We want the Friendly Name to be something like “Company-Name Support-Team”.
Best to get different values respecting the queue the ticket is opened.

I tried to set the From: in templates, but of course it does not set the friendly name, only. It overriedes the from-adress from the queue, too.

So any ideas how to set a nice Friendly Name for AutoReply without patching the source?
We try to use a clean source and use configuration or callbacks instead.

Awaiting your surprising ideas :slight_smile:
Andre.

Code: lib/RT/Action/Autoreply.pm

sub SetReturnAddress {
    my $self = shift;

    my $friendly_name;

    if (RT->Config->Get('UseFriendlyFromLine')) {
        $friendly_name = $self->TicketObj->QueueObj->Description ||
            $self->TicketObj->QueueObj->Name;
    }

    $self->SUPER::SetReturnAddress( @_, friendly_name => $friendly_name );

}

Would the FriendlyFromLineFormat config variable help you? This lets you specify a sprintf() that is used by the SetFrom() method in lib/RT/Action/SendEmail.pm to actually set the From line in the email. If you put a pattern in there had zero width string replacements to ignore the friendly name but just had a fixed string such as “Company Name Support Team %.0s <%s>”, would that work for you?

This way we’ll loose the very nice “Real Name via RT” thing, too. The problem is just in Autoreply.pm.

I talk to the departments to alter the description to be more usable as FriendlyName.
If this fails I’ll use an overlay to alter SetReturnAddress(). They have to define a goog name anyway.

An Overlay will work of course. We just try to do as much things as possible with configuration.

Thank you and regards. Andre.

Hi,

Havent the solution, but i confirm the “form” var in template is broken with autoreply.
The value bellow:
Form: “Company-Name Support-Team”
Is see by the receipient as: “Company-Name Support Team” @serverlocalname

Kind regards,

@periway this is a nice idea I didn’t think about. You need to set the whole ‘From:’ in a template.

 `From: Company-Name Support-Team <support@company.com>` 

will work as expected in the mail-headers. The @serverlocalname was appended by the local mailsystem, not RT.

We’re not sure to use a specific template for each different From: -line or to use an overlay and set the FriendlyName.

The queue-description one can read in SelfService and the From: -line of a mail have different needs we’re not able to get together in one text. So we need two different things.

regards, Andre.