# Html field for email

**URL:** <https://discuss.elastic.co/t/html-field-for-email/123809>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [March 13, 2018, 9:04pm UTC](https://discuss.elastic.co/t/html-field-for-email/123809 "2018-03-13T21:04:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pororo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pororo/32/27711_2.png) [@Pororo](https://discuss.elastic.co/u/Pororo)\
**Post date:** [March 13, 2018, 9:04pm UTC](https://discuss.elastic.co/t/html-field-for-email/123809/1 "2018-03-13T21:04:39Z")

</div>

I was trying to set the html for the email alerting in watcher. What I did is to copy and paste my html code into the body.html field. But it caused some indent problems that the system could not recognize it is a valid html. So I just typed my html code into one whole long line at that filed and it worked fine for some simple html. When it was involved some complicated situations like img url or something like that. One whole long line of html code still cause the invalid warning. Is there any way to efficiently input the html code to that field?

---

<div class="post-metadata">

**Author:** ![Bill\_McConaghy](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@Bill\_McConaghy](https://discuss.elastic.co/u/Bill_McConaghy)\
**Post date:** [March 15, 2018, 7:59pm UTC](https://discuss.elastic.co/t/html-field-for-email/123809/2 "2018-03-15T19:59:44Z")

</div>

I suspect that the issue with img tags had to do with the quotation marks around src="...", etc. Did you try escaping those? (\<img src="...") I do not know of a better way to input the value for that field at the moment.

---

<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:** [March 15, 2018, 8:48pm UTC](https://discuss.elastic.co/t/html-field-for-email/123809/3 "2018-03-15T20:48:45Z")

</div>

You might be able to change the HTML sanitizer allow/deny settings to be able to write the HTML you want. See [https://www.elastic.co/guide/en/x-pack/6.2/actions-email.html#email-html-sanitization](https://www.elastic.co/guide/en/x-pack/6.2/actions-email.html#email-html-sanitization)

---

<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:** [April 12, 2018, 8:48pm UTC](https://discuss.elastic.co/t/html-field-for-email/123809/4 "2018-04-12T20:48:50Z")

</div>

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