# TWIG enabling in M6.0.3

**URL:** <https://forum.mautic.org/t/twig-enabling-in-m6-0-3/36177>\
**Category:** Product Support\
**Created:** [July 23, 2025, 4:25pm UTC](https://forum.mautic.org/t/twig-enabling-in-m6-0-3/36177 "2025-07-23T16:25:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jamesl/32/12585_2.png) [@jamesl](https://forum.mautic.org/u/jamesl)\
**Post date:** [July 23, 2025, 4:25pm UTC](https://forum.mautic.org/t/twig-enabling-in-m6-0-3/36177/1 "2025-07-23T16:25:37Z")

</div>

**Your software**  
My Mautic version is: 6.03  
My PHP version is: 8.1  
My Database type and version is: Latest

**Your problem**  
My problem is:  
I am trying to add twig in code mode in M6.0.3  
how do I enable it?

I have installed mautic as a normal installation and have not touched anything.

1. My emails are full of twig code and is not converting
2. I have added twig code tothe Code Mode template and pasted it into the Advanced tab and HTML area there

Please assist since noone seems to know whereto find it abd how to enable it.  
There is nothging like enable twig or similar in hteadvanced tab.

Please assist  
These errors are showing in the log:

Steps I have tried to fix the problem:

---

<div class="post-metadata">

**Author:** ![jamesl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jamesl/32/12585_2.png) [@jamesl](https://forum.mautic.org/u/jamesl)\
**Post date:** [July 23, 2025, 5:13pm UTC](https://forum.mautic.org/t/twig-enabling-in-m6-0-3/36177/2 "2025-07-23T17:13:53Z")

</div>

when I usethe  
{% TWIG\_BLOCK %}

Dear {{ contact.firstname }},

{% if contact.company\_notes is defined and contact.company\_notes %}

_{{ contact.company\_notes }}_

{% endif %}

{% END\_TWIG\_BLOCK %}

no variables are collected from the contact profile

---

<div class="post-metadata">

**Author:** ![jamesl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jamesl/32/12585_2.png) [@jamesl](https://forum.mautic.org/u/jamesl)\
**Post date:** [July 25, 2025, 7:05am UTC](https://forum.mautic.org/t/twig-enabling-in-m6-0-3/36177/3 "2025-07-25T07:05:26Z")

</div>

I found how you do it  
you simply open email and select code mode and hten enter the advanced tab and htere you can add twig code.

all started working after i added the module Advanced Templates and started adding the {% TWIG\_BLOCK %} andend block

it is superior to use this as it can be tailored to a lot.

do not forgetto use the lead.{variable} when you use this module.  
the result is fantastic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [July 26, 2025, 7:06pm UTC](https://forum.mautic.org/t/twig-enabling-in-m6-0-3/36177/4 "2025-07-26T19:06:24Z")

</div>

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