我有一个使用聚合从查询中检索到的项目列表。我想在我的电子邮件中打印这个项目列表,每个项目都显示在单独的一行上。现在,我可以打印所有内容,但所有内容都会一个接一个地出现,即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>"
}
}
}可以这样打印吗?
发布于 2019-07-26 21:41:20
我可以使用以下命令格式化这些项目。
"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>"
}
}
}https://stackoverflow.com/questions/57210617
复制相似问题