# Recipient variable in Watcher email template?

**URL:** <https://discuss.elastic.co/t/recipient-variable-in-watcher-email-template/67670>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [November 30, 2016, 7:25pm UTC](https://discuss.elastic.co/t/recipient-variable-in-watcher-email-template/67670 "2016-11-30T19:25:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffedwards](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jeffedwards](https://discuss.elastic.co/u/jeffedwards)\
**Post date:** [November 30, 2016, 7:25pm UTC](https://discuss.elastic.co/t/recipient-variable-in-watcher-email-template/67670/1 "2016-11-30T19:25:08Z")

</div>

I want to load a link in an email with the recipient's email as a parameter, but this email is going to multiple recipients and their addresses won't appear in the payload. Is there a {{\_recipient}} variable I can use? Or do I have write new alerts for each recipient?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 1, 2016, 9:15am UTC](https://discuss.elastic.co/t/recipient-variable-in-watcher-email-template/67670/2 "2016-12-01T09:15:46Z")

</div>

Hey,

so the `to` field of an email can be an array, so there is no need to have a new alert for each recipient. You could put this into the [metadata](https://www.elastic.co/guide/en/x-pack/5.0/how-watcher-works.html#watch-definition) field of a watch.

--Alex

---

<div class="post-metadata">

**Author:** ![jeffedwards](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@jeffedwards](https://discuss.elastic.co/u/jeffedwards)\
**Post date:** [December 1, 2016, 3:41pm UTC](https://discuss.elastic.co/t/recipient-variable-in-watcher-email-template/67670/3 "2016-12-01T15:41:21Z")

</div>

Thanks. I'll definitely be making use of that in the future.

Maybe I'm being a bit thick, but how could I reference only the email's recipient in a link using that array? I've got an endpoint I'm trying to link to which takes `?email=[responder email address]` so I can tell who is hitting that endpoint without the user having to enter their address.

---

<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:** [December 29, 2016, 3:41pm UTC](https://discuss.elastic.co/t/recipient-variable-in-watcher-email-template/67670/4 "2016-12-29T15:41:23Z")

</div>

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