# HTML eMail rendering issue

**URL:** <https://discuss.elastic.co/t/html-email-rendering-issue/120549>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [February 20, 2018, 2:37am UTC](https://discuss.elastic.co/t/html-email-rendering-issue/120549 "2018-02-20T02:37:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthik\_Ramachandran](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@Karthik\_Ramachandran](https://discuss.elastic.co/u/Karthik_Ramachandran)\
**Post date:** [February 20, 2018, 2:37am UTC](https://discuss.elastic.co/t/html-email-rendering-issue/120549/1 "2018-02-20T02:37:19Z")

</div>

I belive the html sanitization comes into effect, but not sure

I'm using below output syntax to the eMail action

{{#ishighuse}} \<td bgcolor="Tomato"\>{{jvminuse}} {{/ishighuse}}

bgcolor setting is not set and always get

28 (28 is a sample value)

If it sanitization issue, what are the elements that sanitization excludes, and how I can set specific elements to be allowed? (or) please advice if I'm missing something

NOTE 1 : cellpadding, cellspacing , border are allowed at TABLE element level

NOTE 2 : Validated that "ishighuse" is true and ensure that the logic passes thru the condition with temporary values.

---

<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:** [February 20, 2018, 8:11am UTC](https://discuss.elastic.co/t/html-email-rendering-issue/120549/2 "2018-02-20T08:11:46Z")

</div>

Hey,

can you try to enable `_styles` for the HTML sanitizer, and use `<td style='background-color: red'>` and see if that works?

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) and [https://www.elastic.co/guide/en/elasticsearch/reference/6.2/notification-settings.html#html-feature-groups](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/notification-settings.html#html-feature-groups)

--Alex

---

<div class="post-metadata">

**Author:** ![Karthik\_Ramachandran](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@Karthik\_Ramachandran](https://discuss.elastic.co/u/Karthik_Ramachandran)\
**Post date:** [February 20, 2018, 6:48pm UTC](https://discuss.elastic.co/t/html-email-rendering-issue/120549/3 "2018-02-20T18:48:50Z")

</div>

Hi Alexander,

Adding the below entry alone didn't work  
xpack.notification.email.html.sanitization:  
allow: \_styles

But, when I added below, it worked  
xpack.notification.email.html.sanitization:  
allow: \_styles,\_tables,\_blocks,\_links,\_formatting  
NOTE: \_blocks,\_links may not be required  
Probably I'm misinterpreting documentation. I didn't explicitly added \_tables etc. initially as the documentation specified "By default, Watcher allows the following features: body, head, \_tables, \_links, \_blocks, \_formatting and img:embedded" -- [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)

Thanks for your help.

---

<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:** [February 21, 2018, 8:07am UTC](https://discuss.elastic.co/t/html-email-rendering-issue/120549/4 "2018-02-21T08:07:52Z")

</div>

Hey,

the option requires you to set all the allowed options at once, so it makes sense that your second try worked, not your first.

Hope that helps!

--Alex

---

<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:** [March 21, 2018, 8:07am UTC](https://discuss.elastic.co/t/html-email-rendering-issue/120549/5 "2018-03-21T08:07:55Z")

</div>

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