Templates with queue name in subject

Here are templates that insert the queue name in the email subject. The
only examples I found in the list archives don’t check whether the queue
name is already in the subject, so each successive email responses makes
RT add the queue name again (Re: (blah) Re: (blah) RT-12345 Whatever).

I used a second variable for the queue name regex because using
$Ticket->QueueObj->Name directly wasn’t being interpolated and I didn’t
care enough to find out why.

Correspondence template:
RT-Attach-Message: yesSubject: { my $s = ($Transaction->Subject||$Ticket->Subject); $s =~ s/^Re:\ //i; my $qn = ($Ticket->QueueObj->Name); $s =~ s/($qn)\ //; $s = “(” . ($Ticket->QueueObj->Name) . ") " . $s; $s;}


Admin Comment template:
Subject: { my $s = ($Transaction->Subject||$Ticket->Subject); $s =~ s/^Re:\ //i; my $qn = ($Ticket->QueueObj->Name); $s =~ s/($qn)\ //; $s =~ s/[Comment]\ //g; $s = “(” . ($Ticket->QueueObj->Name) . ") [Comment] " . $s; $s;}

This is a comment. It is not sent to the Requestor(s):