# Adding JavaScript to Email-Builder

**URL:** https://forum.mautic.org/t/adding-javascript-to-email-builder/30622
**Category:** General Discussion
**Tags:** discussion, mautic3, email
**Created:** [January 23, 2024, 5:06pm UTC](https://forum.mautic.org/t/adding-javascript-to-email-builder/30622 "2024-01-23T17:06:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![batijko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/batijko/32/6450_2.png) [@batijko](https://forum.mautic.org/u/batijko)
#### Post date: [January 23, 2024, 5:06pm UTC](https://forum.mautic.org/t/adding-javascript-to-email-builder/30622/1 "2024-01-23T17:06:13Z")

</div>

Hey everyone,

I’m facing an issue while attempting to add JavaScript to my email template within Mautic’s builder. When I include JavaScript code, the entire template breaks, and I can only see the output of the script without any other content:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/68777719659d2e56bb06bf0a0ff2befd248f3c4e.png)  
I’ve tried various slot types, but the result remains the same. The problem is resolved when I edit the template in code mode:  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/1/12757255ad4cb9d7411d9d94e6e06f270ce45d52.png)

I’m currently still using Mautic version 3.3.3. Is this a known issue, and has it been addressed in later versions? Or am I missing something in the process?

Thank you for your help.

---

<div class="post-metadata">

### Author: ![peter\_k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/peter_k/32/511_2.png) [@peter\_k](https://forum.mautic.org/u/peter_k)
#### Post date: [January 23, 2024, 6:18pm UTC](https://forum.mautic.org/t/adding-javascript-to-email-builder/30622/2 "2024-01-23T18:18:27Z")

</div>

What do you want to achieve?

Emails don’t support javascript.

You might want to look at [GitHub - content-optimizer-gmbh/mautic-advanced-templates-bundle: Plugin extends default email template capabilities with TWIG block so you can use advanced scripting techniques like conditions, loops etc](https://github.com/content-optimizer-gmbh/mautic-advanced-templates-bundle) if you want to have something dynamic.

---

<div class="post-metadata">

### Author: ![batijko](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/batijko/32/6450_2.png) [@batijko](https://forum.mautic.org/u/batijko)
#### Post date: [January 23, 2024, 6:33pm UTC](https://forum.mautic.org/t/adding-javascript-to-email-builder/30622/3 "2024-01-23T18:33:13Z")

</div>

Ah, I didn’t know that. But the plugin would pretty much solve my issue. I will have a look at it.

Very much appreciated.
