# Sending Payload with email alert

**URL:** <https://discuss.elastic.co/t/sending-payload-with-email-alert/174477>\
**Category:** Kibana\
**Created:** [March 29, 2019, 6:19am UTC](https://discuss.elastic.co/t/sending-payload-with-email-alert/174477 "2019-03-29T06:19:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ApekshaB](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/apekshab/32/63273_2.png) [@ApekshaB](https://discuss.elastic.co/u/ApekshaB)\
**Post date:** [March 29, 2019, 6:19am UTC](https://discuss.elastic.co/t/sending-payload-with-email-alert/174477/1 "2019-03-29T06:19:40Z")

</div>

Dear team,  
I have a watcher as below. I wish to send payload with my email, but below is displaying result as: "Hit Count : 7 Other test: "  
Kindly help me in this regards.

{  
"actions": {  
"Email\_alarm\_4bb3efa5-8b8b-4237-a037-19a5fdd7db8f": {  
"name": "!!! Alert !!!",  
"throttle\_period": "1m",  
"email": {  
"priority": "high",  
"stateless": false,  
"body": "Hit Count : {{payload.hits.total}} Other {{payload.hits.text}} test: {{payload.hits.hits[1].total\_points}}}",  
"to": "[abc@wer.com](mailto:abc@wer.com)",  
"from": "[kibana@wer.com](mailto:kibana@wer.com)",  
"subject": "TX amount bw 10000 and 10001"  
}  
}  
},  
"input": {  
"search": {  
"request": {  
"index": [  
"apek\_01"  
],  
"body": {  
"query": {  
"bool": {  
"must": [  
{  
"range": {  
"txn\_amount": {  
"gte": 10000,  
"lte": 10001  
}  
}  
},  
{  
"range": {  
"request\_time": {  
"gte": "now-10000h/h"  
}  
}  
}  
]  
}  
}  
}  
}  
}  
},  
"condition": {  
"script": "payload.hits.total \> 0; String payload.hits.text; for (int i = 0; i \<= payload.hits.total; i++){payload.hits.text += 'Id Event: ' + payload.hits.hits[i].\_source.txn\_id + '\n';} return payload.hits.text;"  
},  
"trigger": {  
"schedule": {  
"later": "every 1 minutes"  
}  
},  
"disable": true,  
"report": true,  
"title": "Watcher\_test\_001",  
"save\_payload": true,  
"spy": false,  
"impersonate": false  
}

Regards.

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [March 29, 2019, 5:02pm UTC](https://discuss.elastic.co/t/sending-payload-with-email-alert/174477/2 "2019-03-29T17:02:26Z")

</div>

Hi, the best source to go for Watcher DSL help is the Elasticsearch category in this forum.

Also, pro tip: always use code formatting around text that needs to keep its pre-formatting. The icon is the markup brackets: `</>`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 26, 2019, 5:14pm UTC](https://discuss.elastic.co/t/sending-payload-with-email-alert/174477/3 "2019-04-26T17:14:49Z")

</div>

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