[rt-users] Changing a tag in a subject
Bob Goldstein
bobg at uic.edu
Wed Sep 21 09:31:46 EDT 2005
>Good day.
>
>We have RT 3.4.4 running.
>
>Our users asked me to insert something in mails generated by RT that
>would help to identify a queue that a ticket belongs to (for sorting
>purposes). To provide this, I decided to change RT tag this way:
>
>[ORG #Queue_Id-Ticket_Id].
I don't know about the character set issue, but I believe RT
parses this tag in the subject if a user replies to an email.
If you change the format in output, but not the parsing
routine, you won't be able to append to a ticket via email.
I'd suggest leaving the tag as is, and adding the queue name
separately afterwards.
bobg
>
>I should say I am not very familiar with Perl, so I was making changes
>I guessed to be correct, but I was not sure enough.
>
>After some tries, the working variant of lib/RT/Action/SendEmail.pm looked
>as follows:
>
>--- line 716
>sub SetSubjectToken {
> my $self = shift;
># - my $tag = "[$RT::rtname #" . $self->Ticket
># +
> my $tag = "[$RT::rtname #" . $self->TicketObj->Queue . "-" . $self->Ticke
>t
> 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" );
> }
>}
>
>For my surprise it worked, and we all were satisfied with this, but
>next day I noticed that subjects of mails, generated by RT_System are
>wrong encoded and are dispayed as question marks (all mail is sent
>in koi8-r). Mails with replies were completely correct though.
>Subjects with no russian letters inside were correct also.
>
>The question is: what did I do wrong?
>
>Thanks for assistance.
>
>--
>Ñ óâàæåíèåì,
> cronfy mailto:cronfy at ipnet.ru
>
>_______________________________________________
>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>Be sure to check out the RT Wiki at http://wiki.bestpractical.com
>
>Buy your copy of our new book, RT Essentials, today!
>
>Download a free sample chapter from http://rtbook.bestpractical.com
>
>
More information about the rt-users
mailing list