# Send alerts to email addresses

**URL:** <https://forum.opensearch.org/t/send-alerts-to-email-addresses/2435>\
**Category:** Alerting\
**Created:** [March 19, 2020, 3:06pm UTC](https://forum.opensearch.org/t/send-alerts-to-email-addresses/2435 "2020-03-19T15:06:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![drikhra](https://avatars.discourse-cdn.com/v4/letter/d/c57346/32.png) [@drikhra](https://forum.opensearch.org/u/drikhra)\
**Post date:** [March 19, 2020, 3:06pm UTC](https://forum.opensearch.org/t/send-alerts-to-email-addresses/2435/1 "2020-03-19T15:06:27Z")

</div>

Hi Community,

Is there a way to send alerts to email addresses?

---

<div class="post-metadata">

**Author:** ![Dandy](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@Dandy](https://forum.opensearch.org/u/Dandy)\
**Post date:** [March 24, 2020, 12:04am UTC](https://forum.opensearch.org/t/send-alerts-to-email-addresses/2435/2 "2020-03-24T00:04:04Z")

</div>

There is no active SMTP support yet. However, if you have a SMTP server that supports API calls, you can setup a webhook to replicate an API call to send an email.

---

<div class="post-metadata">

**Author:** ![t364749568](https://avatars.discourse-cdn.com/v4/letter/t/dc4da7/32.png) [@t364749568](https://forum.opensearch.org/u/t364749568)\
**Post date:** [April 1, 2020, 4:43pm UTC](https://forum.opensearch.org/t/send-alerts-to-email-addresses/2435/3 "2020-04-01T16:43:00Z")

</div>

hello I use mail webhook  
in the ‘Edit trigger’page when i click send test message - it works and i receive the message  
i click run the condition it return true  
but the State is ERROR and no message i received

 ![图片](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/1X/37bf5322760947addfa4eb7df4a7f27a31a8ebbc.png)

next is my trigger condition  
{  
“periodStart”: “2020-04-01T15:07:11Z”,  
“periodEnd”: “2020-04-01T15:08:11Z”,  
“results”: [  
{  
“\_shards”: {  
“total”: 3,  
“failed”: 0,  
“successful”: 3,  
“skipped”: 0  
},  
“hits”: {  
“hits”: ,  
“total”: {  
“value”: 64,  
“relation”: “eq”  
},  
“max\_score”: null  
},  
“took”: 6,  
“timed\_out”: false  
}  
],  
“trigger”: {  
“id”: “zwvnNXEBwMN0O-c2EvEL”,  
“name”: “do-step-test”,  
“severity”: “1”,  
“condition”: {  
“script”: {  
“source”: “ctx.results[0].hits.total.value \> 0”,  
“lang”: “painless”  
}  
},  
“actions”: [  
{  
“id”: “0AvnNXEBwMN0O-c2EvEL”,  
“name”: “ddoo”,  
“destination\_id”: “qBrjGXEBk\_jphUw9-xB0”,  
“message\_template”: {  
“source”: “{"content": "Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue- Trigger: {{ctx.trigger.name}}- Severity: {{ctx.trigger.severity}}- Period start: {{ctx.periodStart}}- Period end: {{ctx.periodEnd}}","sender":"monitor@ddang.com","subject": "Monitor {{ctx.monitor.name}}","tos":["zhangsang@ddang.com"]}”,  
“lang”: “mustache”  
},  
“throttle\_enabled”: false,  
“subject\_template”: {  
“source”: “TheSubject”,  
“lang”: “mustache”  
}  
}  
]  
},  
“alert”: null,  
“error”: null,  
“monitor”: {  
“type”: “monitor”,  
“schema\_version”: 1,  
“name”: “do-info-50min”,  
“enabled”: true,  
“enabled\_time”: 1585135352002,  
“schedule”: {  
“period”: {  
“interval”: 1,  
“unit”: “MINUTES”  
}  
},  
“inputs”: [  
{  
“search”: {  
“indices”: [  
“ddang\_809432\_2020-04”  
],  
“query”: {  
“size”: 0,  
“query”: {  
“bool”: {  
“must”: [  
{  
“range”: {  
“log\_time”: {  
“from”: “now-50m”,  
“to”: null,  
“include\_lower”: true,  
“include\_upper”: true,  
“time\_zone”: “+08:00”,  
“format”: “yyyy-MM-dd”,  
“boost”: 1  
}  
}  
},  
{  
“match”: {  
“log\_level”: {  
“query”: “INFO”,  
“operator”: “OR”,  
“prefix\_length”: 0,  
“max\_expansions”: 50,  
“fuzzy\_transpositions”: true,  
“lenient”: false,  
“zero\_terms\_query”: “NONE”,  
“auto\_generate\_synonyms\_phrase\_query”: true,  
“boost”: 1  
}  
}  
}  
],  
“adjust\_pure\_negative”: true,  
“boost”: 1  
}  
}  
}  
}  
}  
],  
“triggers”: [  
{  
“id”: “zwvnNXEBwMN0O-c2EvEL”,  
“name”: “do-step-test”,  
“severity”: “1”,  
“condition”: {  
“script”: {  
“source”: “ctx.results[0].hits.total.value \> 0”,  
“lang”: “painless”  
}  
},  
“actions”: [  
{  
“id”: “0AvnNXEBwMN0O-c2EvEL”,  
“name”: “ddoo”,  
“destination\_id”: “qBrjGXEBk\_jphUw9-xB0”,  
“message\_template”: {  
“source”: “{"content": "Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue- Trigger: {{ctx.trigger.name}}- Severity: {{ctx.trigger.severity}}- Period start: {{ctx.periodStart}}- Period end: {{ctx.periodEnd}}","sender":"monitor@ddang.com","subject": "Monitor {{ctx.monitor.name}}","tos":["zhangsang@ddang.com"]}”,  
“lang”: “mustache”  
},  
“throttle\_enabled”: false,  
“subject\_template”: {  
“source”: “TheSubject”,  
“lang”: “mustache”  
}  
}  
]  
}  
],  
“last\_update\_time”: 1585752307506,  
“ui\_metadata”: {  
“schedule”: {  
“cronExpression”: “0 \*/1 \* \* \*”,  
“period”: {  
“unit”: “MINUTES”,  
“interval”: 1  
},  
“timezone”: null,  
“daily”: 0,  
“monthly”: {  
“type”: “day”,  
“day”: 1  
},  
“weekly”: {  
“tue”: false,  
“wed”: false,  
“thur”: false,  
“sat”: false,  
“fri”: false,  
“mon”: false,  
“sun”: false  
},  
“frequency”: “interval”  
},  
“search”: {  
“aggregationType”: “count”,  
“fieldName”: “”,  
“overDocuments”: “all documents”,  
“searchType”: “query”,  
“bucketValue”: 1,  
“timeField”: “”,  
“groupedOverTop”: 5,  
“bucketUnitOfTime”: “h”,  
“where”: {  
“fieldName”: ,  
“fieldRangeEnd”: 0,  
“fieldRangeStart”: 0,  
“fieldValue”: “”,  
“operator”: “is”  
},  
“groupedOverFieldName”: “bytes”  
},  
“thresholds”: {  
“tttttt”: {  
“value”: 10000,  
“enum”: “ABOVE”  
},  
“ddo-stepup-test”: {  
“value”: 10000,  
“enum”: “ABOVE”  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![praveensameneni](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@praveensameneni](https://forum.opensearch.org/u/praveensameneni)\
**Post date:** [September 6, 2020, 7:58am UTC](https://forum.opensearch.org/t/send-alerts-to-email-addresses/2435/4 "2020-09-06T07:58:38Z")

</div>

We have a [PR](https://github.com/opendistro-for-elasticsearch/alerting/pull/244) in progress for supporting email destination. Please follow the updates on the PR. Closing the issue, however feel free to open it if there are further questions. The original pull request to support Mail destination can be found [here](https://github.com/opendistro-for-elasticsearch/alerting/pull/102).

---

<div class="post-metadata">

**Author:** ![praveensameneni](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@praveensameneni](https://forum.opensearch.org/u/praveensameneni)\
**Post date:** [September 6, 2020, 7:58am UTC](https://forum.opensearch.org/t/send-alerts-to-email-addresses/2435/5 "2020-09-06T07:58:59Z")

</div>


