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

**URL:** <https://discuss.elastic.co/t/how-to-send-multiple-email-attachments-to-multiple-recipients-from-single-watcher/309009>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [July 6, 2022, 11:50am UTC](https://discuss.elastic.co/t/how-to-send-multiple-email-attachments-to-multiple-recipients-from-single-watcher/309009 "2022-07-06T11:50:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Souvik\_Das](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souvik_das/32/107606_2.png) [@Souvik\_Das](https://discuss.elastic.co/u/Souvik_Das)\
**Post date:** [July 6, 2022, 11:50am UTC](https://discuss.elastic.co/t/how-to-send-multiple-email-attachments-to-multiple-recipients-from-single-watcher/309009/1 "2022-07-06T11:50:29Z")

</div>

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](https://us1.discourse-cdn.com/elastic/original/3X/2/c/2c6ff46efdb38f90ad47006104733245d7105857.png) error.

```auto
"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

---

<div class="post-metadata">

**Author:** ![Souvik\_Das](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/souvik_das/32/107606_2.png) [@Souvik\_Das](https://discuss.elastic.co/u/Souvik_Das)\
**Post date:** [July 7, 2022, 7:07am UTC](https://discuss.elastic.co/t/how-to-send-multiple-email-attachments-to-multiple-recipients-from-single-watcher/309009/2 "2022-07-07T07:07:06Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 4, 2022, 7:08am UTC](https://discuss.elastic.co/t/how-to-send-multiple-email-attachments-to-multiple-recipients-from-single-watcher/309009/3 "2022-08-04T07:08:08Z")

</div>

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