[SOLVED] Changed Reply Subject Template

Moderator: crythias

Locked
shaitand
Znuny newbie
Posts: 35
Joined: 09 Sep 2011, 23:17
Znuny Version: 3.0.10

[SOLVED] Changed Reply Subject Template

Post by shaitand »

We are having trouble with a vendors email system and they believe it is caused by the brackets around the ticket number in replies. Is there any way to change this?
Last edited by shaitand on 17 Oct 2011, 20:21, edited 1 time in total.
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Changed Reply Subject Template

Post by crythias »

This is in
Kernel/System/Ticket.pm

Code: Select all

    # return subject for new tickets
    if ( $Param{Type} && $Param{Type} eq 'New' ) {
        if ( lc $TicketSubjectFormat eq 'right' ) {
            return $Subject . " [$TicketHook$TicketHookDivider$Param{TicketNumber}]";
        }
        if ( lc $TicketSubjectFormat eq 'none' ) {
            return $Subject;
        }
        return "[$TicketHook$TicketHookDivider$Param{TicketNumber}] " . $Subject;
    }

    # return subject for existing tickets
    if ( $Action eq 'Forward' ) {
        if ($TicketSubjectFwd) {
            $TicketSubjectFwd .= ': ';
        }
        if ( lc $TicketSubjectFormat eq 'right' ) {
            return $TicketSubjectFwd . $Subject
                . " [$TicketHook$TicketHookDivider$Param{TicketNumber}]";
But beware that it *might* have a problem to learn the ticket number if the []'s are removed or aren't replaced with ... something.
I haven't tested what would happen, but this only tells you where it's constructed (might yet be another place in Ticket.pm, but it'd likely be around this area.)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Changed Reply Subject Template

Post by jojo »

Brackets are allowed in subjects, so this won't help..
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
shaitand
Znuny newbie
Posts: 35
Joined: 09 Sep 2011, 23:17
Znuny Version: 3.0.10

Re: Changed Reply Subject Template

Post by shaitand »

Brackets may be allowed by spec but are uncommon and many vendors don't expect them (or are already using them in their own system). Changing the subject required a few changes in the code beside the area mentioned above. Attached is a patch that changes the square brackets out with -, adding the appropriate cleanup code but leaving the [] cleanup as well so it won't conflict with existing tickets. All changes are in Kernel/System/Ticket.pm.

Patch at:

http://bugs.otrs.org/show_bug.cgi?id=7834
Locked