# Multi-paragraph text injected through token

**URL:** <https://forum.mautic.org/t/multi-paragraph-text-injected-through-token/31188>\
**Category:** Product Support\
**Created:** [March 7, 2024, 2:19pm UTC](https://forum.mautic.org/t/multi-paragraph-text-injected-through-token/31188 "2024-03-07T14:19:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.szabo](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@chris.szabo](https://forum.mautic.org/u/chris.szabo)\
**Post date:** [March 7, 2024, 2:19pm UTC](https://forum.mautic.org/t/multi-paragraph-text-injected-through-token/31188/1 "2024-03-07T14:19:57Z")

</div>

**Your software**  
My Mautic version is: 4.4.10  
My PHP version is: 8.0.30  
My Database type and version is: MariaDB - 10.6.16

**Your problem**  
My problem is:  
I need to inject multi-paragraph content into an email template. The number of paragraphs can vary, and therefore I can’t create one token for each paragraph, in the builder, as that would require that I know beforehand how many paragraphs there will be.

PS: to whatever extent this matters, I want to send these emails programmatically, by using the API’s send email endpoint. I am only mentioning this because I am starting to get the impression that tokens are handled slightly differently when sending through the API, but I might be wrong here.

Steps I have tried to fix the problem:

- Newlines get ignored when the mail is rendered as HTML
- The string that gets inserted into the token is HTML escaped by default, so adding tags doesn’t help, as they will just show up as raw text
- In a desperate attempt, I’ve even tried sending an array of strings, but that doesn’t work either, it gets turned into the string “Array”

I have searched around, and in some places it is implied that HTML content should be supported, but I haven’t managed to get it to work. In other discussions that I have found, it is implied that this is not a supported feature (yet?). I am a bit confused. Is there any way I can achieve what I want?

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [March 7, 2024, 4:03pm UTC](https://forum.mautic.org/t/multi-paragraph-text-injected-through-token/31188/2 "2024-03-07T16:03:13Z")

</div>

Is “some places” the mautic documentation? Please add an issue in github then. If not, there is a chance that its not supported yet. So this might then be a feature request (its a category in the forum.

I will try in the next days myself, as we also focus heavily on using the API.

---

<div class="post-metadata">

**Author:** ![chris.szabo](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@chris.szabo](https://forum.mautic.org/u/chris.szabo)\
**Post date:** [March 7, 2024, 4:18pm UTC](https://forum.mautic.org/t/multi-paragraph-text-injected-through-token/31188/3 "2024-03-07T16:18:26Z")

</div>

The mautic documentation hints that HTML is supported, but is not completely clear if this applies to custom tokens. I mostly meant these forums, when I wrote “some places”.
