Reporting back search results via email


Is it possible to configure a Watcher to attach the search query results to the email once it's fired?



yes, you can just iterate through the search hits in the body of an email action. Results would be available in ctx.payload.hits.hits if you only have one search input.

You might want to check out this blog post how to efficiently write and debug watches, it should shorten your testing cycles -I know it's pretty long, but worth it (spoiler: I wrote it, I might be biased :slight_smile:


Hi Alex,

thanks for the reply.
Is there a more specific example for iterating through the search hits?
I got kind of lost in your blog post...


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