Format List of Items in Email

I have a list of items retrieved from my query using aggregations. I want to print this list of items in my email with each appearing on a separate line. Right now I can print everything but it all appears one after the other i.e. file1.txt file2.txt. I would like for it to appear like

file1.txt
file2.txt

Below is the action to create the email.

"actions": {
	"email_users": {
		"email": {
			"profile": "standard",
			"to": [
				"jcarpenter@mydomain.com"
			],
			"subject": "File Identifier",
			"body": {
				"html": "<p>Files could not be identified due bad receiver id.  There were {{ctx.payload.hits.total}} files that could not be identified.</p> <ul><li>{{#ctx.payload.aggregations.file_name.buckets}}{{key}}{{/ctx.payload.aggregations.file_name.buckets}}</li></ul>"
			}
		}
	}

Can I print the items this way?

I was able to format the items using the following command.

"actions": {
"email_users": {
  "email": {
	"profile": "standard",
	"to": [
	  "jcarpenter@mydomain.com"
	],
	"subject": "File Identifier",
	"body": {
	  "html": "<p>Files could not be identified due bad receiver id.  There were {{ctx.payload.hits.total}} files that could not be identified.</p> <div><ul>{{#ctx.payload.aggregations.file_name.buckets}}{{#key}}<li>{{.}}</li>{{/key}}{{/ctx.payload.aggregations.file_name.buckets}}</ul></div><p>These files have been sent to quarantine.</p>"
	}
  }
}

looks good. I think you could just go with <li>{{key}}</li> as well on top of my head!

--Alex

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