Watcher: multiple email accounts

Hi ES experts,

I'm trying to configure several Email accounts in elasticsearch.yml:

xpack.notification.email.account:
  acc1:
    profile: standard
    email_defaults:
      from: mail1@dom1.net
    smtp:
      auth: true
      starttls.enable: true
      host: smpt.dom1.net
      port: 587
      user: user1@dom1.net
      password: ******
  acc2:
    profile: gmail
    email_defaults:
      from: mail2@gmail.com
    smtp:
      auth: true
      starttls.enable: true
      host: smtp.gmail.com
      port: 587
      user: mail2
      password: *****

Which parameter do I need to use to specify, which email account should be taken? Is it the parameter account like this (the parameter profile gets added automatically for some reason):

  "actions": {
    "send_email": {
      "email": {
        "account": "acc1",
        "profile": "standard",
        "priority": "highest",
        "to": [
          "rec@dom1.net"
        ],
        "subject": "Watcher - Alert",
        "body": {
          "text": "{{ctx.payload}}"
        }
      }
    }
  }

Unfortunately it is not clear from the documentation

The problem is - no email gets sent, no errors in the logs...

Thanks a lot!

Hey,

can you share the output of the execute watch API when running the watch?

Also, did you put the account configuration into all of your nodes?

Apart from that the configuration looks ok as well as how to specify the account in the watch itself.

--Alex

hi Alex,

thanks for the prompt reply! I'm really sorry, the emails were sent successfully, but they landed into the spam folder, and I did not see them, that's why I thought the config was wrong :slight_smile:
Anyhow, it would be good to mention the parameter account on the documentation...

1 Like

It is mentioned here - which documentation are you referring to, so we can add it?

I apologize, I must have overlooked it :frowning:
or, you just added it? :slight_smile:
Thank you again!

I promise I didnt add it, that would be mean :slight_smile:

glad you found it. As always, if you are missing anything in the docs, happy to get PRs or open issues

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.