Sharath
8 months agoNeophyte
Email Ingestion
Dear Community, We've been endeavouring to monitor unread emails using the Email Ingest Eventsource. However, I encountered a Java error ("Unable to resolve the class") during implementation. Upon i...
Rereading this post and it occurs to me that you would probably do better with a datasource rather than an eventsource. Are you looking for pure unread count per mailbox? Or are you trying to use the subject line matching in the code to only count the number of unreads matching your given subject? If you're just looking for unread emails that match the default subject line in the code, you could replace this line:
debugOutput(debug, "foundCount: ${foundCount}")
with this line:
println("foundCount: ${foundCount}")
And comment out this line:
println(new JsonBuilder(events).toPrettyString())
Make this your datasource script and make a datapoint called foundCount using multi-line key/pair with the key of "foundCount".
If the script is currently marking items as read, it should continue to do that, but the datapoint should reflect the number of items it marked as read.