# Inconsistent newlines in email body text

**URL:** <https://discuss.elastic.co/t/inconsistent-newlines-in-email-body-text/148681>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [September 14, 2018, 9:15pm UTC](https://discuss.elastic.co/t/inconsistent-newlines-in-email-body-text/148681 "2018-09-14T21:15:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgburks](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@jgburks](https://discuss.elastic.co/u/jgburks)\
**Post date:** [September 14, 2018, 9:15pm UTC](https://discuss.elastic.co/t/inconsistent-newlines-in-email-body-text/148681/1 "2018-09-14T21:15:18Z")

</div>

I'm using this Watcher code to send myself emails:

```
"body": {
  "text": "{{#ctx.payload.hits.hits}}{{_source.@timestamp}} {{_source.message}}\n{{/ctx.payload.hits.hits}}"

```

```auto

But I don't get a newline in the email body between hits. But when I add some extra characters around the newline like this:

    "body": {
      "text": "{{#ctx.payload.hits.hits}}{{_source.@timestamp}} {{_source.message}} *\n* {{/ctx.payload.hits.hits}}"

```

The newline magically appears between the asterisks. This is the latest ELK stack with Kibana 6.4.

Why is this inconsistent? I just want a simple list of my hits in the email body.

Thanks

---

<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:** [September 17, 2018, 7:42am UTC](https://discuss.elastic.co/t/inconsistent-newlines-in-email-body-text/148681/2 "2018-09-17T07:42:41Z")

</div>

Hey

I suppose you are hitting this one: [https://github.com/elastic/elasticsearch/issues/26882](https://github.com/elastic/elasticsearch/issues/26882)

--Alex

---

<div class="post-metadata">

**Author:** ![jgburks](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@jgburks](https://discuss.elastic.co/u/jgburks)\
**Post date:** [September 17, 2018, 12:29pm UTC](https://discuss.elastic.co/t/inconsistent-newlines-in-email-body-text/148681/3 "2018-09-17T12:29:58Z")

</div>

Thanks. I just switched to HTML and that seems to get me what I want.

---

<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:** [October 15, 2018, 12:29pm UTC](https://discuss.elastic.co/t/inconsistent-newlines-in-email-body-text/148681/4 "2018-10-15T12:29:59Z")

</div>

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