I put the contents of my NLog email text message into a file and render it using the FileContents renderer. What I would like to do is hide some parts of the html output if the rendering of the layout creates an empty string
<div>Request ticket: ${httpContextItems:key=RequestTicket}</div>
I am not sure of the syntax for the condition / property . Here are a few attempts:
${httpContextItems:key=RequestTicket:when:length>0}
<div>Request ticket: ${httpContextItems:key=RequestTicket}</div>
${??? How to enclose? }
And NLog doesn't like this enclosed stuff:
${when:when=length(${httpContextItems:key=RequestTicket})=0:inner=<div>Request ticket: ${httpContextItems:key=RequestTicket}</div>}
source
share