How to send multiple email attachments to multiple recipients from single watcher

Hi,

The objective is to send multiple email attachments to multiple groups of recipients from a single watcher script.

I want to achieve the below but getting image error.

"actions": {
    "email_admin": {
      "email": {
        "profile": "standard",
        "attachments": {
          "dashboard1.pdf": {
            "reporting": {
              "url": "http://xxx.xx.x.xx:5601/s/alerting/api/reporting/generate/printablePdf?...dashboard1",
              "auth": {
                "basic": {
                  "username": "elastic",
                  "password": "pass"
                }
              }
            }
          }
        },
        "from": "from_email@domain.com",
        "to": ["abc@xyz.com,bcd@xyz.com"],
        "subject": "trial - dashboard 1",
        "body": {
          "text": "Please find the attached"
        }
      },
      "email": {
        "profile": "standard",
        "attachments": {
          "dashboard2.pdf": {
            "reporting": {
              "url": "http://xxx.xx.x.xx:5601/s/alerting/api/reporting/generate/printablePdf?...dashboard2",
              "auth": {
                "basic": {
                  "username": "elastic",
                  "password": "pass"
                }
              }
            }
          }
        },
        "from": "from_email@domain.com",
        "to": ["mno@xyz.com,cdo@xyz.com"],
        "subject": "trial - dashboard 2",
        "body": {
          "text": "Please find the attached"
        }
      }
    }
  }

I know that the error is because of the two email blocks under email_admin which I have placed to achieve the goal but was unsuccessful.

Please advise me what are the changes need to be done under the actions block to achieve what I needed.

Regards,
Souvik

Found the solution. Used two email_admin, taking two different names under actions block i.e. email_admin_1 and email_admin_2 and it worked!

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