How to enchance the body text in email actions while using watcher in elasticsearch

This is my action part of my watcher:
"actions" : {
"email_admin" : {
"email" : {
"to" : "vishnumk@company.com",
"subject" : "Priority : High State : Down ",
"body": {
"text": "Portal_URL:{{#ctx.payload.hits.hits}} {{_source.http.url}} {{/ctx.payload.hits.hits}} Time:{{#ctx.payload.hits.hits}} {{_source.@timestamp}} {{/ctx.payload.hits.hits}} Error:{{#ctx.payload.hits.hits}} {{_source.error.message}} {{/ctx.payload.hits.hits}}"
}
}
}
}

Im getting email as follows
Portal_URL: http://172.24.12.124:9204 Time: 2019-05-09T09:28:51.090Z Error: 401 Unauthorized

But i want email in below format:

Portal_URL: http://172.24.12.124:9204
Time: 2019-05-09T09:28:51.090Z
Error: 401 Unauthorized

try adding newlines using \n

--Alex

Thank You:smile:

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