[otrs] E-Mail-Ticket-Template -> "To"-Field and CC / BCC

560 views
Skip to first unread message

Julius Haake

unread,
Aug 3, 2016, 6:57:57 AM8/3/16
to ot...@otrs.org
Dear List,
I am fiddling around with E-Mail-Ticket-Templates, this is very nice, we need to send standardized E-Mails very often, submitting some data.
I used the youtube vid from https://www.youtube.com/watch?v=1B8mZ9Ku_bA

Creating the button for the template in "AgentTicketEmail.tt" and filling in the fields for Subject, Body, etc. is trivial, I am looking for a solution to prefill the fields for customer, CC and BCC.

Does any1 know a way? Sniffing through source code, I already tried the obvious names like "ToCustomer", etc.

My "code":
# example template form for customizations
<form action="[% Env("CGIHandle") %]" method="post" enctype="multipart/form-data" id="Template1">
    <input type="hidden" name="Action" value="[% Env("Action") %]"/>
    <input type="hidden" name="Subaction" value="StoreNew"/>
#     <input type="hidden" name="ToCustomer" value="ma...@mail.com"/>
#    <input type="hidden" name="CcCustomer" value="j.h...@kk-es.de"/>
    <input type="hidden" name="FormID" value="[% Data.FormID | html %]"/>
    <input type="hidden" name="ExpandCustomerName" value="2"/>
    <input type="hidden" name="Dest" value="16||Things"/>
    <input type="hidden" name="Subject" value="New Problem in section XX pipe YY"/>
    <input type="hidden" name="Body" value="you are *****ed"/>
</form>

It works fine, except for the Customer and CC-Fields :/

Any help is highly appreciated!

BR
Julius

Never Min

unread,
Aug 3, 2016, 7:11:22 AM8/3/16
to User questions and discussions about OTRS., User questions and discussions about OTRS.
Hi Julius,

You can try this:
http://opar.perl-services.de/dist/TemplateX-5.0.0

I hope will be help.


-Never

---------------------------------------------------------------------
OTRS mailing list: otrs - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs
To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs

Julius Haake

unread,
Aug 3, 2016, 8:10:19 AM8/3/16
to ot...@lists.otrs.org
Dear Never, thank you for the good hint, I just installed the template (without errors) - unfortunately it is not showing up in the admin menu :/ I did a refresh of my configuration though.

BR Julius

Never Min

unread,
Aug 3, 2016, 10:28:22 AM8/3/16
to User questions and discussions about OTRS.

2016-08-03 20:10 GMT+08:00 Julius Haake <julius...@gmail.com>:
Dear Never, thank you for the good hint, I just installed the template (without errors) - unfortunately it is not showing up in the admin menu :/ I did a refresh of my configuration though.

BR Julius

Gerald Young

unread,
Aug 3, 2016, 11:05:18 AM8/3/16
to User questions and discussions about OTRS.
I may be missing something. Are you saying that the items that are commented (leading #) are not functional?

Julius Haake

unread,
Aug 10, 2016, 10:04:44 AM8/10/16
to ot...@lists.otrs.org
Gerald, thank you for your answer.

I commented them out after testing. In fact the fields are not working, I cannot fill in the customer ID or, to be precise, I just don't know the correct field-Names for customer-ID, CC, BCC, etc.

>Are they nonfunctional because they're commented or is it simply
>coincidental that you indicated the nonfunctional entities by prefacing
>them with a comment in what you posted?

Any help is highly appreciated

BR
Julius

Gerald Young

unread,
Aug 10, 2016, 10:25:25 AM8/10/16
to User questions and discussions about OTRS.
I believe the problem with To and Cc is because of the fancy interface to providing entries to To and Cc.

my $CustomersNumberCc = $Self->{ParamObject}->GetParam( Param => 'CustomerTicketCounterCcCustomer' ) || 0;

    if ($CustomersNumberCc) {
        my $CustomerCounterCc = 1;
        for my $Count ( 1 ... $CustomersNumberCc ) {
            my $CustomerElementCc = $Self->{ParamObject}->GetParam( Param => 'CcCustomerTicketText_' . $Count );
            my $CustomerKeyCc     = $Self->{ParamObject}->GetParam( Param => 'CcCustomerKey_' . $Count )

Basically, there is an internal counter that is used to apply the entry:
<input name="CustomerTicketCounterCcCustomer" id="CustomerTicketCounterCcCustomer" type="hidden" value="0"/>

The following may be of use:
<input name="CustomerTicketCounterCcCustomer" id="CustomerTicketCounterCcCustomer" type="hidden" value="1">
<input name="CcCustomerKey_1" id="CcCustomerKey_1" class="CustomerKey" type="hidden" value="mycustomerusername">
<input class="CustomerTicketText" title="Cc" name="CcCustomerTicketText_1" id="CcCustomerTicketText_1" type="hidden" value="myv...@mydomain.com" readonly="readonly" aria-invalid="false">


Julius Haake

unread,
Aug 11, 2016, 5:03:51 AM8/11/16
to ot...@lists.otrs.org
Hi, I just tried your good idea, it is working for exactly one CC-Field-Entry. If I try to add another CC-Customer it is ignoring the additional fields. I tried to increase the values (value="2") - its not working. Any Idea? :/

Quote:
>The following may be of use:
><input name="CustomerTicketCounterCcCustomer"
>id="CustomerTicketCounterCcCustomer" type="hidden" value="1">
><input name="CcCustomerKey_1" id="CcCustomerKey_1" class="CustomerKey"
>type="hidden" value="mycustomerusername">
><input class="CustomerTicketText" title="Cc" name="CcCustomerTicketText_1"
>id="CcCustomerTicketText_1" type="hidden" value="myv...@mydomain.com"
>readonly="readonly" aria-invalid="false">

Your help is appreciated!

Br
Julius

Julius Haake

unread,
Aug 11, 2016, 5:36:50 AM8/11/16
to ot...@lists.otrs.org
Hurray, solved my problem for main-customer:

<input name="CustomerTicketCounterToCustomer"id="CustomerTicketCounterToCustomer" type="hidden" value="1">
<input name="CustomerKey_1" id="CustomerKey_1" class="CustomerKey" type="hidden" value="mym...@mail.com">
<input class="CustomerTicketText" title="An Kundenbenutzer" name="CustomerTicketText_1"
id="CustomerTicketText_1" type="hidden" value="mym...@mail.com"
readonly="readonly" area-invalid="false">

One step closer! Just the problem with more than one CC-Field is left!


Gerald Young

unread,
Aug 11, 2016, 9:10:50 PM8/11/16
to User questions and discussions about OTRS.
I'm not clear on what you tried to do. Please look at "Inspect Element" of the web page just in case this isn't correct.

<input name="CustomerTicketCounterCcCustomer" id="CustomerTicketCounterCcCustomer" type="hidden" value="2">
<input name="CcCustomerKey_1" id="CcCustomerKey_1" class="CustomerKey" type="hidden" value="mycustomerusername">
<input class="CustomerTicketText" title="Cc" name="CcCustomerTicketText_1" id="CcCustomerTicketText_1" type="hidden" value="myv...@mydomain.com" readonly="readonly" aria-invalid="false">
<input name="CcCustomerKey_2" id="CcCustomerKey_2" class="CustomerKey" type="hidden" value="my2ndcustomerusername">
<input class="CustomerTicketText" title="Cc" name="CcCustomerTicketText_2" id="CcCustomerTicketText_2" type="hidden" value="my2nd...@my2nddomain.com" readonly="readonly" aria-invalid="false">

Julius Haake

unread,
Aug 18, 2016, 9:08:14 AM8/18/16
to ot...@lists.otrs.org
Dear Gerald, it works like a charm, the value-counter needs to be the number of CC-Fields I want to fill. So if I have 4 CC-Users, value="" logically needs to be 4.
Thank you for your time and help! Problem solved

BR
Julius
Reply all
Reply to author
Forward
0 new messages