dynamic fields in notification email template

Moderator: crythias

Locked
dyabolik00
Znuny newbie
Posts: 14
Joined: 20 Jan 2017, 16:20
Znuny Version: 50000
Real Name: Matei Sebastian Alin

dynamic fields in notification email template

Post by dyabolik00 »

Hello,
I have this issue.
I've create a custom notification base on a dynamic field status (dtstatus) that has multiple states: (active,inprogress,completed). This notification is triggered when the dynamic field change to completed and it send an email to the customer that open that process ticket.
The email arrive just fine and i'm using a custom template stored in /opt/otrs/Kernel/Output/HTML/Templates/Standard/NotificationEvent/Email/
I try everything to send via that email some dynamic field of that ticketprocess but i'm unambled to see them.
In my custom tt file i tried:
[% Ticket.DynamicField_Surname %]
[% Data.Ticket.DynamicField_Surname %]
[% Data.DynamicField_Surname %]
[% Data.Surname %]
[% Surname %]
[% Ticket.Surname %]
[% DynamicField_Surname %]
<OTRS_TICKET_DynamicField_Surname>
<OTRS_TICKET_DynamicField_Surname_Value>
<OTRS_TICKET_DynamicField_Surname>

None of that work :( . is there a way to do this? or how do i pass the dynamicfield for that email body?
I've looked at /opt/otrs/Kernel/System/Ticket/Event/NotificationEvent/Transport/Email.pm and i dont see any reference for dynamicfields.
root
Administrator
Posts: 4253
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: dynamic fields in notification email template

Post by root »

In the notification templates are only Subject and Body set. Place your DynamicField into the notification.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
dyabolik00
Znuny newbie
Posts: 14
Joined: 20 Jan 2017, 16:20
Znuny Version: 50000
Real Name: Matei Sebastian Alin

Re: dynamic fields in notification email template

Post by dyabolik00 »

root wrote:In the notification templates are only Subject and Body set. Place your DynamicField into the notification.
You mean in the Email.pm file?
I found this:
# generate HTML
$Notification{Body} = $LayoutObject->Output(
TemplateFile => "NotificationEvent/Email/$EmailTemplate",
Data => {
TicketID => $Param{TicketID},
Body => $Notification{Body},
Subject => $Notification{Subject},
},
);

but i dont see any reference to dynamicfields in this file. I tried adding %Param, to data array but nothing :(. How can i add all dynamic field to this?
root
Administrator
Posts: 4253
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: dynamic fields in notification email template

Post by root »

Use the DynamicField in the notification body with the proper tag.
2017-01-21 at 10.10 AM.jpeg
You do not have the required permissions to view the files attached to this post.
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
dyabolik00
Znuny newbie
Posts: 14
Joined: 20 Jan 2017, 16:20
Znuny Version: 50000
Real Name: Matei Sebastian Alin

Re: dynamic fields in notification email template

Post by dyabolik00 »

root wrote:Use the DynamicField in the notification body with the proper tag.
2017-01-21 at 10.10 AM.jpeg
Wow man! I've try that first and didnt work(i've done it from editor sourcecode and the string disapered :) )! I've lost hours in finding the code in pm files and it was sooo easy!
Tanks so much!
Locked