0

我有一个使用聚合从我的查询中检索到的项目列表。我想在我的电子邮件中打印这个项目列表,每个项目都出现在单独的行上。现在我可以打印所有内容,但它们都一个接一个地出现,即file1.txt file2.txt. 我希望它看起来像

file1.txt
file2.txt

以下是创建电子邮件的操作。

"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>"
            }
        }
    }

我可以这样打印项目吗?

4

1 回答 1

0

我能够使用以下命令格式化项目。

"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>"
    }
  }
}
于 2019-07-26T13:41:20.143 回答