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

I've looked at /opt/otrs/Kernel/System/Ticket/Event/NotificationEvent/Transport/Email.pm and i dont see any reference for dynamicfields.