Watcher Send to Multiple Emails Action

Hello! I have a problem regarding sending to multiple emails. The watch can be put to the elasticsearch, but once you execute it, the email action will report an error:

        "id": "email_admin",
        "type": "email",
        "status": "failure",
        "reason": "AddressException[Illegal address]"

Below is my configuration:

"email_admin": { 
     "email": {
            "to" : "'Name 1 <email>', 'Name2 <email>' ", 
            "subject" : "{{ctx.watch_id}} executed", 
            "body" : "message" 

This is what I have in the elasticsearch.yml:
        profile: gmail
            from: 'Name <>'
            auth: true
            starttls.enable: true
            port: 587
            password: <password>

I want to know if this is the right way of doing it. I need to notify several people, hence, multiple emails should be considered in the "to" field of the action. By the way, I also tried to send to just one email, and I didn't come up with an error.


you can use an array, see the email address docs.


Sorry, I can't seem to get the docs. How can I do it using array?

Address List:

A list of addresses can be specified as an array: [ 'user1@host.domain', 'user2@host.domain' ]

I tried to do what you suggested, but I'm still getting the same error

I browsed some of the topics related to my question. I found out that this was already resolved.
It should be:

"to" : ["name1@email", "name2@email"]

Thanks to your help and suggestions! :smile: