Add Customer Name to Email Subject
Moderator: crythias
Add Customer Name to Email Subject
Dear All,
How to add the customer Name to the email Subject of the Responses ?
Actually there is only the ticket number and ticket tile.
Regards,
How to add the customer Name to the email Subject of the Responses ?
Actually there is only the ticket number and ticket tile.
Regards,
OTRS 3.0.9, Mysql, Centos
Re: Add Customer Name to Email Subject
What i am looking for is when I send an email from a ticket, i would like that in the Email Subject we see the Ticket Number, Customer Name and Ticket Title
Rgds,
Rgds,
OTRS 3.0.9, Mysql, Centos
-
- Znuny newbie
- Posts: 5
- Joined: 13 Oct 2011, 19:28
- Znuny Version: 3.0.4
- Real Name: Georges
Re: Add Customer Name to Email Subject
Hello,
I am trying to do the same here, to find a way to add "Customer Company name" or "CustomerID" automatically in the Ticket Subject upon an email update.
The following tag already exist in OTRS: <OTRS_TICKET_CustomerID> but no tag for the Company Name...
I have tried to insert the previous tag into the ticket hook (Ticket > Core::Ticket > Ticket::Hook), but without success.
Note: Having Customer Company Name in ticket subject is crucial for organizing users & agents mail-boxes (as they most use incoming filters...) as well as for quickly identifying the customer involved with a ticket follow-up upon a quick email check. And it would be also great if we can add ticket Priority as well.
Thanks in advance for any help.
I am trying to do the same here, to find a way to add "Customer Company name" or "CustomerID" automatically in the Ticket Subject upon an email update.
The following tag already exist in OTRS: <OTRS_TICKET_CustomerID> but no tag for the Company Name...
I have tried to insert the previous tag into the ticket hook (Ticket > Core::Ticket > Ticket::Hook), but without success.
Note: Having Customer Company Name in ticket subject is crucial for organizing users & agents mail-boxes (as they most use incoming filters...) as well as for quickly identifying the customer involved with a ticket follow-up upon a quick email check. And it would be also great if we can add ticket Priority as well.
Thanks in advance for any help.
OTRS::ITSM 3.0.10 on Linux with MySQL database.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add Customer Name to Email Subject
You might be able to modify Ticket.pm. We generally figure the from address relates to the customer...
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
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
-
- Znuny newbie
- Posts: 5
- Joined: 13 Oct 2011, 19:28
- Znuny Version: 3.0.4
- Real Name: Georges
Re: Add Customer Name to Email Subject
Crythias, thanks for the hint.
I am now able to add static text to the Subject by editing the return clauses in TicketSubjectBuild subroutine.
i.e: return "[$TicketHook$TicketHookDivider$Param{TicketNumber}] " . "STATIC TEXT HERE - " . $Subject;
But it seems other ticket information is missing from the $Param array.. the only information available is Ticket Number, Subject, and Type.
I also found that TicketSubjectBuild is called from the module AgentTicketEmail.pm... Is there any guide explaining how the code works and how to modify it?
Thanks
I am now able to add static text to the Subject by editing the return clauses in TicketSubjectBuild subroutine.
i.e: return "[$TicketHook$TicketHookDivider$Param{TicketNumber}] " . "STATIC TEXT HERE - " . $Subject;
But it seems other ticket information is missing from the $Param array.. the only information available is Ticket Number, Subject, and Type.
I also found that TicketSubjectBuild is called from the module AgentTicketEmail.pm... Is there any guide explaining how the code works and how to modify it?
Thanks
OTRS::ITSM 3.0.10 on Linux with MySQL database.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add Customer Name to Email Subject
$Param{CustomerID} doesn't work?
If you want the Customer Company, you'll have to add
CustomerCompanyGet()
get customer company attributes
then
Nothing tested, but it should get you on your way.
If you want the Customer Company, you'll have to add
Code: Select all
use Kernel::System::CustomerCompany;
get customer company attributes
Code: Select all
my %CustomerCompany;
if ($Param{CustomerID}) {
%CustomerCompany = $CustomerCompanyObject->CustomerCompanyGet(
CustomerID => $Param{CustomerID},
);
}
Code: Select all
. $CustomerCompany{CustomerCompanyName}.
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
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
-
- Znuny newbie
- Posts: 5
- Joined: 13 Oct 2011, 19:28
- Znuny Version: 3.0.4
- Real Name: Georges
Re: Add Customer Name to Email Subject
in Ticket.pm and within the subroutine TicketSubjectBuild(), $Param{CustomerID} doesn't work.. no value returned
$Param only holds ticket number, subject, and type (reply, new, forward)
$Param only holds ticket number, subject, and type (reply, new, forward)
OTRS::ITSM 3.0.10 on Linux with MySQL database.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add Customer Name to Email Subject
$Self is a Ticket Object
... other stuff previously posted.
Again, not tested, but this is based upon the API. If it doesn't work, it may be something syntax error, but if I understood the code, this is close.
Code: Select all
my $TicketID = $Self->TicketIDLookup(
TicketNUmber => $Param{TicketNumber},
UserID => 1,
);
my %Ticket = $Self->TicketGet(
TicketID => $TicketID,
UserID =>1,
);
$Param{CustomerID} = $Ticket{CustomerID};
Again, not tested, but this is based upon the API. If it doesn't work, it may be something syntax error, but if I understood the code, this is close.
-
- Znuny newbie
- Posts: 5
- Joined: 13 Oct 2011, 19:28
- Znuny Version: 3.0.4
- Real Name: Georges
Re: Add Customer Name to Email Subject
thanks, it works like charm for getting the TicketID and CustomerID, but when it comes to the CustomerCompany section of the code, I wasn't able to fix it and the browser keeps giving me this error:
Some forum threads mention the need to add an event handler... any idea?
Best Regards
which corresponds exactly to:Software error:
Can't call method "CustomerCompanyGet" on an undefined value at /opt/otrs//Kernel/System/Ticket.pm line 791.
For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.
Code: Select all
790 if ( $Param{CustomerID} ) {
791 my %CustomerCompany = $Self->{CustomerCompanyObject}->CustomerCompanyGet( CustomerID => $Param{CustomerID}, );
792 }
Best Regards
OTRS::ITSM 3.0.10 on Linux with MySQL database.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Add Customer Name to Email Subject
You can't use $Self->CustomerCompanyObject because $Self is a TicketObject.
You'd need to create a new CustomerCompanyObject to get the info.
Check out dev.otrs.org for how to accomplish that. Basically,
Don't forget the use Kernel::System::CustomerCompany; at the top
You'd need to create a new CustomerCompanyObject to get the info.
Check out dev.otrs.org for how to accomplish that. Basically,
Code: Select all
my $CustomerCompanyObject = Kernel::System::CustomerCompany->new(
ConfigObject => $Self->{ConfigObject},
LogObject => $Self->{LogObject},
DBObject => $Self->{DBObject},
TimeObject => $Self->{TimeObject},
EncodeObject => $Self->{EncodeObject},
MainObject => $Self->{MainObject},
);
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
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
-
- Znuny newbie
- Posts: 5
- Joined: 13 Oct 2011, 19:28
- Znuny Version: 3.0.4
- Real Name: Georges
Re: Add Customer Name to Email Subject
Thanks a lot for your help
the following code did the trick within Ticket.pm / sub New { }
I'll be working next on using the ticket Title in all email Forward & Reply instead of using the Subject from the last email received. I hope it won't make much trouble 
Cheers!

the following code did the trick within Ticket.pm / sub New { }
Code: Select all
$Self->{CustomerCompanyObject} = Kernel::System::CustomerCompany->new(%Param);

Cheers!
OTRS::ITSM 3.0.10 on Linux with MySQL database.