Use OTRS NOTIFICATION TAG to display Company

Moderator: crythias

Locked
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

Hi all,
I need to display Customer Company in Email Subject on Email Notifications to Agents.
I would like to use <OTRS_CUSTOMER_DATA_*> Tags, rather that create an answer for each Company, but can't figure out how to.
Any help would be appreciated.

Regards

DD
KlausNehrer
Znuny ninja
Posts: 1312
Joined: 25 May 2012, 08:51
Znuny Version: OTRS 4
Real Name: Klaus Nehrer

Re: Use OTRS NOTIFICATION TAG to display Company

Post by KlausNehrer »

<OTRS_CUSTOMER_DATA_Firma>
<OTRS_CUSTOMER_DATA_UserCustomerID>

Note the mapping
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

Hi KlausNehrer, thank's for answering.
KlausNehrer wrote:<OTRS_CUSTOMER_DATA_Firma>
<OTRS_CUSTOMER_DATA_UserCustomerID>
<OTRS_CUSTOMER_DATA_Firma> displays nothing
<OTRS_CUSTOMER_DATA_UserCustomerID> works properly, it displays the Customer ID which can be found in the Customer Configuration Page.
KlausNehrer wrote: Note the mapping
What do you mean?

Thank you

DD
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

Hi, anyone?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Use OTRS NOTIFICATION TAG to display Company

Post by jojo »

show your customer map from Config.pm as Klaus already requested
"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
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

Excuse me, didn't understand Klaus was asking that.

Could you please tell me which lines of which file shoud I post?

Regards

DD
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Use OTRS NOTIFICATION TAG to display Company

Post by jojo »

show your Customer Configuration from Config.pm
"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
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

Hi, this is my /opt/otrs/Kernel/Config.pm, hope is the correct file.
I've removed the database settings part.

# ---------------------------------------------------- #
# fs root directory
# ---------------------------------------------------- #
$Self->{Home} = '/opt/otrs';

# ---------------------------------------------------- #
# insert your own config settings "here" #
# config settings taken from Kernel/Config/Defaults.pm #
# ---------------------------------------------------- #
# $Self->{SessionUseCookie} = 0;
# $Self->{CheckMXRecord} = 0;

# Enable Customer Company linking.
$Self->{CustomerUser}->{CustomerCompanySupport} = 1;
# ---------------------------------------------------- #

# ---------------------------------------------------- #
# data inserted by installer #
# ---------------------------------------------------- #
# $DIBI$
$Self->{'DefaultCharset'} = 'utf-8';

# ---------------------------------------------------- #
# ---------------------------------------------------- #
# #
# End of your own config options!!! #
# #
# ---------------------------------------------------- #
# ---------------------------------------------------- #
}

# ---------------------------------------------------- #
# needed system stuff (don't edit this) #
# ---------------------------------------------------- #
use strict;
use warnings;

use vars qw(@ISA $VERSION);
$VERSION = qw($Revision: 1.23 $)[1];

use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');

# -----------------------------------------------------#

1;
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Use OTRS NOTIFICATION TAG to display Company

Post by jojo »

there is no Customer Part in it. Please show your customer database settings
"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
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

jojo wrote:there is no Customer Part in it. Please show your customer database settings
Please, jojo, where can I find these informations?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Use OTRS NOTIFICATION TAG to display Company

Post by jojo »

it should be in the Config.pm. But as it not there it might be in Defaults.pm or in some other files. Please ask the person who did the setup
"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
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

Wonderful.. I did the setup! :D
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

Ok, maybe I found it... /opt/otrs/Kernel/Config/Defaults.pm

# customer #
CustomerID => 'customer_id',
CustomerValid => 'valid_id',
CustomerUserListFields => [ 'first_name', 'last_name', 'email' ],

# CustomerUserListFields => ['login', 'first_name', 'last_name', 'customer_id', 'email'],
CustomerUserSearchFields => [ 'login', 'first_name', 'last_name', 'customer_id' ],
CustomerUserSearchPrefix => '*',
CustomerUserSearchSuffix => '*',
CustomerUserSearchListLimit => 250,
CustomerUserPostMasterSearchFields => ['email'],
CustomerUserNameFields => [ 'title', 'first_name', 'last_name' ],
CustomerUserEmailUniqCheck => 1,

# # show now own tickets in customer panel, CompanyTickets
# CustomerUserExcludePrimaryCustomerID => 0,
# # generate auto logins
# AutoLoginCreation => 0,
# # generate auto login prefix
# AutoLoginCreationPrefix => 'auto',
# # admin can change customer preferences
# AdminSetPreferences => 1,
# # use customer company support (reference to company, See CustomerCompany settings)
CustomerCompanySupport => 1,
# # cache time to live in sec. - cache any database queries
# CacheTTL => 0,
# # just a read only source
# ReadOnly => 1,
Map => [

# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
[ 'UserTitle', 'Title', 'title', 1, 0, 'var', '', 0 ],
[ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var', '', 0 ],
[ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var', '', 0 ],
[ 'UserLogin', 'Username', 'login', 1, 1, 'var', '', 0 ],
[ 'UserPassword', 'Password', 'pw', 0, 0, 'var', '', 0 ],
[ 'UserEmail', 'Email', 'email', 1, 1, 'var', '', 0 ],

# [ 'UserEmail', 'Email', 'email', 1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"Article$
[ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
[ 'UserCompanyID', 'CompanyID', 'company_id', 0, 1, 'var', '', 0 ],

# [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 0, 'var', '', 0 ],
[ 'UserPhone', 'Phone', 'phone', 1, 0, 'var', '', 0 ],
[ 'UserFax', 'Fax', 'fax', 1, 0, 'var', '', 0 ],
[ 'UserMobile', 'Mobile', 'mobile', 1, 0, 'var', '', 0 ],
[ 'UserStreet', 'Street', 'street', 1, 0, 'var', '', 0 ],
[ 'UserZip', 'Zip', 'zip', 1, 0, 'var', '', 0 ],
[ 'UserCity', 'City', 'city', 1, 0, 'var', '', 0 ],
[ 'UserCountry', 'Country', 'country', 1, 0, 'var', '', 0 ],
[ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ],
[ 'ValidID', 'Valid', 'valid_id', 0, 1, 'int', '', 0 ],
],
# default selections
Selections => {

# UserTitle => {
# 'Mr.' => 'Mr.',
# 'Mrs.' => 'Mrs.',
# },
},
};


Hope it helps.

DD
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

In the same file:

$Self->{CustomerCompany} = {
Params => {
# if you want to use an external database, add the
# required settings
# DSN => 'DBI:odbc:yourdsn',
# DSN => 'DBI:mysql:database=customerdb;host=customerdbhost',
# User => '',
# Password => '',
Table => 'customer_company',
},

# customer uniq id
CustomerCompanyKey => 'customer_id',
CustomerCompanyValid => 'valid_id',
CustomerCompanyListFields => [ 'customer_id', 'name' ],
CustomerCompanySearchFields => ['customer_id', 'name'],
CustomerCompanySearchPrefix => '',
CustomerCompanySearchSuffix => '*',
CustomerCompanySearchListLimit => 250,
Map => [
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Use OTRS NOTIFICATION TAG to display Company

Post by jojo »

Show Customer Company Map
"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
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

This is the tuotorial I've followed:

http://pynej.blogspot.it/2010/06/tracki ... -otrs.html
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Use OTRS NOTIFICATION TAG to display Company

Post by jojo »

Defaults.pm is not allowd to be changed! And please show the Map for Companies.
"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
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

I'm really sorry but can't understand what do you mean.

Where can i find the "Map for Companies"?
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Use OTRS NOTIFICATION TAG to display Company

Post by jojo »

Map => [
......
];
"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
dd4v3
Znuny newbie
Posts: 13
Joined: 08 Mar 2013, 18:18
Znuny Version: 3.2.2

Re: Use OTRS NOTIFICATION TAG to display Company

Post by dd4v3 »

That was posted on my previuos message (Defaults.pm):

Map => [

# note: Login, Email and CustomerID needed!
# var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly, http-link-target
[ 'UserTitle', 'Title', 'title', 1, 0, 'var', '', 0 ],
[ 'UserFirstname', 'Firstname', 'first_name', 1, 1, 'var', '', 0 ],
[ 'UserLastname', 'Lastname', 'last_name', 1, 1, 'var', '', 0 ],
[ 'UserLogin', 'Username', 'login', 1, 1, 'var', '', 0 ],
[ 'UserPassword', 'Password', 'pw', 0, 0, 'var', '', 0 ],
[ 'UserEmail', 'Email', 'email', 1, 1, 'var', '', 0 ],

# [ 'UserEmail', 'Email', 'email', 1, 1, 'var', '$Env{"CGIHandle"}?Action=AgentTicketCompose&ResponseID=1&TicketID=$Data{"TicketID"}&ArticleID=$Data{"Article$
[ 'UserCustomerID', 'CustomerID', 'customer_id', 0, 1, 'var', '', 0 ],
[ 'UserCompanyID', 'CompanyID', 'company_id', 0, 1, 'var', '', 0 ],

# [ 'UserCustomerIDs', 'CustomerIDs', 'customer_ids', 1, 0, 'var', '', 0 ],
[ 'UserPhone', 'Phone', 'phone', 1, 0, 'var', '', 0 ],
[ 'UserFax', 'Fax', 'fax', 1, 0, 'var', '', 0 ],
[ 'UserMobile', 'Mobile', 'mobile', 1, 0, 'var', '', 0 ],
[ 'UserStreet', 'Street', 'street', 1, 0, 'var', '', 0 ],
[ 'UserZip', 'Zip', 'zip', 1, 0, 'var', '', 0 ],
[ 'UserCity', 'City', 'city', 1, 0, 'var', '', 0 ],
[ 'UserCountry', 'Country', 'country', 1, 0, 'var', '', 0 ],
[ 'UserComment', 'Comment', 'comments', 1, 0, 'var', '', 0 ],
[ 'ValidID', 'Valid', 'valid_id', 0, 1, 'int', '', 0 ],
],


Isn't it what you need?
agaver
Znuny newbie
Posts: 1
Joined: 24 Feb 2015, 18:26
Znuny Version: 3.1.3

Re: Use OTRS NOTIFICATION TAG to display Company

Post by agaver »

I was having the same problem where I couldn't get the Company Data to link to the Customer ID.
After many readings I found the following link:
http://lists.otrs.org/pipermail/otrs/20 ... 23916.html

I have OTRS 3.1.3 and after following the instructions on the link I was able to link Customer IDs to their respective Company Names.
And, more importantly to also use <OTRS_CUSTOMER_DATA_CustomerCompanyName> to reference the correct Company Name
to be sent on automated notifications!

Thank you everybody!
---------------------------------------------------------------------------------------------------------------------
With the following information:
Greg Smith wrote:
> How do I assign customer users to a company?
# AdminSetPreferences => 1,
# use customer company support (reference to company, See CustomerCompany settings)
CustomerCompanySupport => 1, <<<<<<----Activate this feature

When you activate this CustomerCompanySupport Feature, then you can use
the Customer Company feature which will allow you to manage your
companies seperate from your customers. Then you will have a dropdown
menu for customerid.
-
Shawn Beasley

((otrs)) :: xxx :: Norsk-Data-Straße 1 :: 61352 Bad Homburg
Fon: +49 (0) 9421 56818 0 :: Fax: +49 (0) 9421 56818 18
http://www.otrs.com/ :: Communication with success!
Locked