Can title be the subject in email templates?
Moderator: crythias
-
- Znuny newbie
- Posts: 36
- Joined: 01 Jun 2015, 10:17
- Znuny Version: 6.0.28
- Real Name: Michael James
Can title be the subject in email templates?
Hello All,
I wonder if the default email subject (when either replying, or using the outbound email button) can be forced to use the title of the ticket?
I'm looking in the templates area - and there is nowhere to change the subject.
Any help much appreciated. Have a great day
Mike F
I wonder if the default email subject (when either replying, or using the outbound email button) can be forced to use the title of the ticket?
I'm looking in the templates area - and there is nowhere to change the subject.
Any help much appreciated. Have a great day
Mike F
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Can title be the subject in email templates?
Hey there,
the building of the subject is hardcoded, e.g. for responding (AgentTicketCompose) it's build with this code:
And finally sent with this code:
So you'd have to customize the files to achieve that.
the building of the subject is hardcoded, e.g. for responding (AgentTicketCompose) it's build with this code:
Code: Select all
# prepare subject
my $Tn = $Self->{TicketObject}->TicketNumberLookup( TicketID => $Self->{TicketID} );
$GetParam{Subject} = $Self->{TicketObject}->TicketSubjectBuild(
TicketNumber => $Tn,
Subject => $GetParam{Subject} || '',
);
Code: Select all
my $ArticleID = $Self->{TicketObject}->ArticleSend(
ArticleTypeID => $GetParam{ArticleTypeID},
SenderType => 'agent',
TicketID => $Self->{TicketID},
HistoryType => 'SendAnswer',
HistoryComment => "\%\%$Recipients",
From => $GetParam{From},
To => $GetParam{To},
Cc => $GetParam{Cc},
Bcc => $GetParam{Bcc},
Subject => $GetParam{Subject},
UserID => $Self->{UserID},
Body => $GetParam{Body},
InReplyTo => $GetParam{InReplyTo},
References => $GetParam{References},
Charset => $Self->{LayoutObject}->{UserCharset},
MimeType => $MimeType,
Attachment => \@AttachmentData,
%ArticleParam,
);
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
-
- Znuny newbie
- Posts: 36
- Joined: 01 Jun 2015, 10:17
- Znuny Version: 6.0.28
- Real Name: Michael James
Re: Can title be the subject in email templates?
Many thanks indeed for your kind reply. So quick!
I'd like to try changing this, but I'm not a confident coder. Would you mind letting me know the filename involved, and what you would change in there? I'm happy to back up the file and have a go at editing this.
All I want is the title to be reported in the subject (along with the normal ticket number).
Thanks again,
Mike F
I'd like to try changing this, but I'm not a confident coder. Would you mind letting me know the filename involved, and what you would change in there? I'm happy to back up the file and have a go at editing this.
All I want is the title to be reported in the subject (along with the normal ticket number).
Thanks again,
Mike F
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Can title be the subject in email templates?
Right, so first locate the file:
then copy it to the Custom folder (so upgrades don't overwrite your change):
you might need to create the folders first:
Then open the file and search for the prepare subject part. Change this part:
to this part:
This should work for version 4.x, don't have a test envirorment for 5 yet
Code: Select all
$HOME/Kernel/Modules/AgentTicketCompose.pm
Code: Select all
cp -p $HOME/Kernel/Modules/AgentTicketCompose.pm $HOME/Custom/Kernel/Modules/AgentTicketCompose.pm
Code: Select all
mkdir -p $HOME/Custom/Kernel/Modules
Code: Select all
my $Tn = $Self->{TicketObject}->TicketNumberLookup( TicketID => $Self->{TicketID} );
$GetParam{Subject} = $Self->{TicketObject}->TicketSubjectBuild(
TicketNumber => $Tn,
Subject => $GetParam{Subject} || '',
);
Code: Select all
my %Ticket = $Self->{TicketObject}->TicketGet(
TicketID => $Self->{TicketID},
DynamicFields => 0,
UserID => 1,
);
my $Tn = $Self->{TicketObject}->TicketNumberLookup( TicketID => $Self->{TicketID} );
$GetParam{Subject} = $Self->{TicketObject}->TicketSubjectBuild(
TicketNumber => $Tn,
Subject => $Ticket{Title} || '',
);
This should work for version 4.x, don't have a test envirorment for 5 yet
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
-
- Znuny newbie
- Posts: 36
- Joined: 01 Jun 2015, 10:17
- Znuny Version: 6.0.28
- Real Name: Michael James
Re: Can title be the subject in email templates?
Apologies for the delay sir. I really appreciate you explaining all that.
Having moved the pm file into the custom folder (which did exist), and editing it according to your instructions - everything worked like a charm.
Excellent help - and thank you
Have a Happy Christmas.
Having moved the pm file into the custom folder (which did exist), and editing it according to your instructions - everything worked like a charm.
Excellent help - and thank you
Have a Happy Christmas.
-
- Znuny guru
- Posts: 2210
- Joined: 13 Mar 2014, 09:16
- Znuny Version: 6.0.14
- Real Name: Rolf Straub
Re: Can title be the subject in email templates?
Glad to help
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Re: Can title be the subject in email templates?
Did anyone test this for Framework 5?
I think this way is Really practical because even if I am writing a third party the mail should include the title.
I think this way is Really practical because even if I am writing a third party the mail should include the title.
Re: Can title be the subject in email templates?
Use forward or reply
"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
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Re: Can title be the subject in email templates?
Of course you're right but why and when should I then use Outgoing eMail?
Re: Can title be the subject in email templates?
Hi
outgoing email is a new mail to 3rd party without involving the customer.
Flo
outgoing email is a new mail to 3rd party without involving the customer.
Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11
-- Ich beantworte keine Forums-Fragen PN - No PN please
I won't answer to unfriendly users any more. A greeting and regards are just polite.
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11
-- Ich beantworte keine Forums-Fragen PN - No PN please
I won't answer to unfriendly users any more. A greeting and regards are just polite.
-
- Znuny guru
- Posts: 5018
- Joined: 13 Mar 2011, 09:54
- Znuny Version: 6.0.x
- Real Name: Renée Bäcker
- Company: Perl-Services.de
- Contact:
Re: Can title be the subject in email templates?
You can use StdSubject from OPAR: http://opar.perl-services.de/dist/StdSubject
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Re: Can title be the subject in email templates?
Thank you very much reneeb! This is exactly what I was looking for and so it perfectly fits.