Alerting : connect email

The last commit ommited a line that actually sends the email on alert trigger.

Original commit: elastic/x-pack-elasticsearch@24b5c01db8
This commit is contained in:
Brian Murphy 2014-08-12 19:54:13 +01:00
parent 5f84596c92
commit 940d6402ae
1 changed files with 2 additions and 1 deletions

View File

@ -56,10 +56,11 @@ public class EmailAlertAction implements AlertAction {
InternetAddress.parse(emailAddresses.get(0)));
message.setSubject("Elasticsearch Alert!");
message.setText(result.searchResponse.toString());
Transport.send(message);
} catch (Exception e){
throw new ElasticsearchException("Failed to send mail", e);
}
//Email here
return true;
}