Send alerts to email addresses

Hi Community,

Is there a way to send alerts to email addresses?

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.

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

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”
}
}
}
}
}