# Highlights in email HTML body

**URL:** <https://discuss.elastic.co/t/highlights-in-email-html-body/1996>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [June 5, 2015, 9:07am UTC](https://discuss.elastic.co/t/highlights-in-email-html-body/1996 "2015-06-05T09:07:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zdeseb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zdeseb/32/42106_2.png) [@zdeseb](https://discuss.elastic.co/u/zdeseb)\
**Post date:** [June 5, 2015, 9:07am UTC](https://discuss.elastic.co/t/highlights-in-email-html-body/1996/1 "2015-06-05T09:07:08Z")

</div>

I tried to include highlighted fragments into HTML email but highlighting tags were lost somewhere ☹

In **ctx.payload.hits.hits[].text** there is text correctly highlighted by **\<em\>** tags but finally in e-mail body these tags disappeared.

Body is rendered by "body.html" xmustache template using following code inside

```
{{#ctx.payload.hits.hits}}
        {{#highlight.text}}<p>{{{.}}}</p>{{/highlight.text}}
{{/ctx.payload.hits.hits}}

```

Somewhere on the way from payload to email body **\<em\>** tags disappears.

---

<div class="post-metadata">

**Author:** ![zdeseb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zdeseb/32/42106_2.png) [@zdeseb](https://discuss.elastic.co/u/zdeseb)\
**Post date:** [June 12, 2015, 10:30am UTC](https://discuss.elastic.co/t/highlights-in-email-html-body/1996/2 "2015-06-12T10:30:56Z")

</div>

My strange problems with HTML body email was solved by following setting

```
watcher.actions.email.sanitize_html: false
```

---

<div class="post-metadata">

**Author:** ![uboness](https://avatars.discourse-cdn.com/v4/letter/u/96bed5/32.png) [@uboness](https://discuss.elastic.co/u/uboness)\
**Post date:** [June 12, 2015, 3:00pm UTC](https://discuss.elastic.co/t/highlights-in-email-html-body/1996/3 "2015-06-12T15:00:47Z")

</div>

Hi,

sorry for not picking this up on time.

yes, current the html sanitizer doesn't allow `<em>` tags... but that should not be the case... we'll fix it in our next release.

Thx for reporting!

---

<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:49pm UTC](https://discuss.elastic.co/t/highlights-in-email-html-body/1996/4 "2017-07-06T13:49:33Z")

</div>


