[rt-users] Multiple Outgoing rtname values in Tags.

Dustin Kanske dustinkanske at gmail.com
Fri Feb 3 20:14:08 EST 2006

Hello all,

Through the RT Site configuration file it is possible to define
Set($EmailSubjectTagRegex, qr/\Q$rtname\E/ ); so that RT will accept
multiple RT tags in the event that you change your rtname. I have a
situation where I would like to have the tag defined based on a property of
the ticket, such as queue name or a custom field. I was curious if anyone
else has come across this need before, and what if any were the solutions?
So far what I have planned to try is to change the SetSubjectToken sub in
lib/RT/Action/SendEmail.pm (RT 3.4.2) as follows:

sub SetSubjectToken {
    my $self = shift;

    my $rtname_map = {
             'QueueName1' => 'tag1',
             'QueueName2' => 'tag2',

    my $tag  = "[$RT::rtname #" . $self->TicketObj->id . "]";

    my $new_rtname = $rtname_map->{$self->TicketObj->QueueObj->Name};
    if ($new_rtname) {
        $tag  = "[$new_rtname #" . $self->TicketObj->id . "]";

    my $sub  = $self->TemplateObj->MIMEObj->head->get('Subject');
    unless ( $sub =~ /\Q$tag\E/ ) {
        $sub =~ s/(\r\n|\n|\s)/ /gi;
        chomp $sub;
        $self->TemplateObj->MIMEObj->head->replace( 'Subject', "$tag $sub"

And also modify any templates and/or scrips as needed

Does this look like it would do the trick?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20060203/bf9b07c1/attachment.htm>

More information about the rt-users mailing list