Ctx.payload.hits.hits in a tabular format within email box

Hi there, have you taken a look at Watcher Email has Incorrect Format Using Mustache Template? This user also asked about formatting of tables in HTML. For that user, they were able to define a body like this to create an HTML table:

<head> <h1>Long Running Processes</h1> </head> <body> <table> <tr><th>Number
     1</th> <th>Number 2</th> </tr>{{#ctx.payload.hits.hits}} <tr><td>1</td> <td>2</td> </tr>
     {{/ctx.payload.hits.hits}}</table> </body>

I think you could adapt this to your use case too.

Hope this helps,
CJ

1 Like