New Line separator for ${message} properties in email alerts

Hey guys,

We use 3.0 version and default email template for alerts. It has

${if backlog}Last messages accounting for this alert:
${foreach backlog message}${message}

${end}${else}<No backlog>
${end}

So ${message} iterates all properties in the message and calls toString for each of them. The problem that it comes as one line and it’s hard to read:

gl2_source_input: 5714fc06e4b0ab1fa3452bc2 | AuthenticatedUser: Some | Url: Some | file: Some.cs | UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36 | gl2_source_node: 68e3141c-dec0-47c5-b3e9-6551f3f845b3 | timestamp: 2019-05-08T08:56:08.509Z | LoggerName: Some | level: 3 | streams: [000000000000000000000001, 56e89a11e4b06ffd908a3ed3] | LogType: 1 | Exception: [System.ArgumentException]:

I’ve read JMTE templates documentation but still not sure how to make each property to be displayed on own line and replace | to \r\n. I understand that i can manually specify each property like this

AuthUser: ${message.fields.AuthenticatedUser}
UserAgent: ${message.fields.UserAgent}

But it won’t work well as we have dynamic properties and they still needs to be present in the email alert. Is there a way to add a new line delimiter for each property in message?

Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.