How to add a To and Cc when use forward template

Moderator: crythias

Post Reply
iwill
Znuny newbie
Posts: 65
Joined: 10 Feb 2021, 10:47
Znuny Version: 6.0
Real Name: William Craveiro

How to add a To and Cc when use forward template

Post by iwill »

Hi there,

My current challenge is to pre-define two emails addresses in the To and Cc field when use a specific forward template in OTRS 6. There is already a post explaining how to use AdminTemplate to set a specific State depending on the Template which is used, but its not fulfill what i want to do.

This is the part of link which is up when o select forward template:

Code: Select all

https://www.XPTO.com/otrs/index.pl?ChallengeToken=mqO1M2IZHBWvjmkqKMlfw4p6u5C3oBJO&Action=AgentTicketForward&TicketID=31922&ArticleID=220386&ForwardAll=&ForwardTemplateID=21
I can use "ForwardTemplateID=21" as a trigger right?

Thanks for your help!
iwill
Znuny newbie
Posts: 65
Joined: 10 Feb 2021, 10:47
Znuny Version: 6.0
Real Name: William Craveiro

Re: How to add a To and Cc when use forward template

Post by iwill »

I have news about, but I still didn't get there:
*If i cant do it by ForwardTemplateID, can i populate To and Cc field when i choose specific value in "To queue" dynamic field?
Image

Code: Select all

$(document).ready(function() {
    setTimeout(function() {
        const Action = Core.Config.Get('Action');
        const SupportedActions = ['AgentTicketForward'];
        if ($.inArray(Action, SupportedActions) !== -1) {
            if (Action === 'AgentTicketForward') {
                const ForwardTemplateID = $('input[name=ForwardTemplateID]').val();
                if (ForwardTemplateID == 21) FillCc('email1@testmail.test');
                else FillCc('Cc')
            }
            else FillCc('Cc@testmail.test')
        }

        function FillCc(email) {
            $('#CcCustomer').val(email).trigger('change');
        }

    }, 0);
});
Post Reply