# Watcher Mail action with custom mustache mail body template

**URL:** <https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [September 11, 2015, 7:49am UTC](https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096 "2015-09-11T07:49:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![om\_panda](https://avatars.discourse-cdn.com/v4/letter/o/aca169/32.png) [@om\_panda](https://discuss.elastic.co/u/om_panda)\
**Post date:** [September 11, 2015, 7:49am UTC](https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096/1 "2015-09-11T07:49:48Z")

</div>

I have a mail action configured in which the mail body template is fetched from a mustache template. i have placed the template file under config/scripts. but getting ElasticsearchIllegalArgumentException[Unable to find on disk script MyMailTemplate.mustache] error.

Please let me know what am i missing.

Thanks

---

<div class="post-metadata">

**Author:** ![kirrg001](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@kirrg001](https://discuss.elastic.co/u/kirrg001)\
**Post date:** [September 15, 2015, 12:40pm UTC](https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096/2 "2015-09-15T12:40:41Z")

</div>

+1 same problem. your docu only has one example for .groovy files.

How to embedd a .mustache template for an email?

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [September 15, 2015, 1:58pm UTC](https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096/3 "2015-09-15T13:58:27Z")

</div>

The file extension should be left out. So if the file in the script directory is 'MyMailTemplate.mustache' then you should specify 'MyMailTemplate' as file in the watch.

---

<div class="post-metadata">

**Author:** ![om\_panda](https://avatars.discourse-cdn.com/v4/letter/o/aca169/32.png) [@om\_panda](https://discuss.elastic.co/u/om_panda)\
**Post date:** [September 19, 2015, 7:14am UTC](https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096/4 "2015-09-19T07:14:44Z")

</div>

I tried with file extension and without also, its same result. Am i missing some settings? can you please provide location to put the file?  
Thanks

---

<div class="post-metadata">

**Author:** ![Diego\_Krulewietki](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@Diego\_Krulewietki](https://discuss.elastic.co/u/Diego_Krulewietki)\
**Post date:** [February 15, 2017, 3:52pm UTC](https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096/5 "2017-02-15T15:52:17Z")

</div>

I am getting the same problem. Has anyone been able to solve it?

---

<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:** [July 6, 2017, 1:42pm UTC](https://discuss.elastic.co/t/watcher-mail-action-with-custom-mustache-mail-body-template/29096/6 "2017-07-06T13:42:02Z")

</div>


