Hello all,
Brief intro: I'm creating watcher alerts with send email actions.
Email fields TO and CC are calculatable, so known only after watch execution and can be transformed before the action.
As noted in the documentation here to field can be either array or email address from template https://www.elastic.co/guide/en/x-pack/current/actions-email.html#email-action-attributes .
Am I right, that I have no chance to format an output with Mustache template with several emails to be successfully executed?
Or there is some hidden feature inside?
a possible trick here might be to have an array of email addresses, that are concatenated using the mustache {{join}} operator, that was added recently.
Hi Alexander,
Thank you for the idea.
However according to the documentation it's still about rendering data as string, so I can just replace it with "to": "email1@mail.com,email2@mail.com" to receive the same result.
And in such cases I receive Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 501 5.1.3 Invalid address exception from mail client
sorry, that was me typing late in the evening. I thought this works, but it does not. I do not have any better idea for now, other that storing the info statically in the watch metadata. I assume you will get that information during the execution? Can you explain your use-case?
Hi,
Regarding metadata I guess it won't work for my use case, please check it below.
Some time ago I've extracted tasks from a bug tracker (JIRA) to elastic, connected with Kibana and everything is perfect.
Now I'm trying to integrate watcher in the process to automatically control issue attributes.
For example use-case: search in elastic issues with invalid label, then send email notification to assignees keeping informed team leamer and project manager.
In transform section I can calculate array of issue assignees as well as dynamic list of team leaders emails, however I wasn't able to provide this info as an recipients array via templating.
So before search query execution I don't know recipient list.
so I dug a bit and it seems there is support for comma separated email addresses in the email component, except for one place, where it is not supported. I will try to add this as soon as possible. Will keep you posted!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.