# Mautic TWIG Advanced Templates Bundle

**URL:** <https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [January 2, 2023, 9:56pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571 "2023-01-02T21:56:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [January 2, 2023, 9:56pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/1 "2023-01-02T21:56:00Z")

</div>

Debian stable  
Mautic 4.4.5  
PHP 7.4.33  
Newest from Debian stable

**Updating/Installing Errors**  
_I am_ (delete as applicable): Installing TWIG Plugin MauticAdvancedTemplatesBundle

_These errors are showing in the installer_ :  
MauticAdvancedTemplatesBundle error php

_These errors are showing in the Mautic log_ :  
none  
**Your problem**  
_My problem is_ :

After copying the plugin files into the plugin directory, and deleting the cache, I can’t access mautic any more.

_Steps I have tried to fix the problem_ :

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [January 2, 2023, 10:05pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/2 "2023-01-02T22:05:12Z")

</div>

What does it show in log files under mautic-root/var/logs

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [January 2, 2023, 10:56pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/3 "2023-01-02T22:56:45Z")

</div>

I did not find any error regarding the problem.  
The error popped up while doing a php bin/console cache:clear

In order to access my Mautic, I deleted the plugin, and after the php bin/console cache:clear command I could access my Mautic again.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 3, 2023, 10:54am UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/4 "2023-01-03T10:54:12Z")

</div>

This plugin?

> **[GitHub - Logicify/mautic-advanced-templates-bundle: Plugin extends default...](https://github.com/Logicify/mautic-advanced-templates-bundle)**
>
> Plugin extends default email template capabilities with TWIG block so you can use advanced scripting techniques like conditions, loops etc - GitHub - Logicify/mautic-advanced-templates-bundle: Plug...

ItS not M4 compatible.

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [January 3, 2023, 3:44pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/5 "2023-01-03T15:44:48Z")

</div>

Yes, this one. Many thanks for your answer.  
Then what can I do? Is there another possibility of doing an “if then else” conditional content handling?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 3, 2023, 4:27pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/6 "2023-01-03T16:27:09Z")

</div>

This plugin is golden.

> **[Twig Templates for Mautic](https://mtcextendee.com/marketplace/twig-templates-for-mautic/)**
>
> Buy now one domain license / 39€ – buy nowunlimited license / 169€ – buy now Buy now one domain license / 39€ – buy nowunlimited license / 169€ – buy now

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [January 4, 2023, 8:01pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/7 "2023-01-04T20:01:06Z")

</div>

Many thanks. Is there a promotion code? 🙂

Kind regards

Christian

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 5, 2023, 7:17am UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/8 "2023-01-05T07:17:14Z")

</div>

No, but if you buy the plugin, you help mautic’s one of most active coder. (I have no affiliation, this plugin is my very honest recommendation.)

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [January 5, 2023, 7:47am UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/9 "2023-01-05T07:47:48Z")

</div>

Many thanks. That’s fair enough!

Have a great day!

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [January 5, 2023, 1:34pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/10 "2023-01-05T13:34:05Z")

</div>

Well, I bought it, I installed it and I wrote the first TWIG template.

The test worked as well.

What does not work is the integration into an email template with:

{twigtemplate=1}

It just does not show the contend.

Hum

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 6, 2023, 1:45pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/11 "2023-01-06T13:45:36Z")

</div>

Did it work for you when you tested in the twig template area?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 6, 2023, 1:45pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/12 "2023-01-06T13:45:50Z")

</div>

BTW - you need a real send, cause test send doesn’t render

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [January 6, 2023, 2:08pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/13 "2023-01-06T14:08:37Z")

</div>

Yes, in the test area it worked!

As you mentioned, it needs a real send.

Many thanks!

---

<div class="post-metadata">

**Author:** ![sfahrenkrog1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sfahrenkrog1/32/4583_2.png) [@sfahrenkrog1](https://forum.mautic.org/u/sfahrenkrog1)\
**Post date:** [February 1, 2023, 3:23pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/14 "2023-02-01T15:23:39Z")

</div>

We have forked the plugin and patched it for Mautic v4. We also add some new features and some bugfixes (error handling for example and some problems with the rendering).

You find it here:

> **[GitHub - content-optimizer-gmbh/mautic-advanced-templates-bundle: Plugin...](https://github.com/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 - GitHub - content-optimizer-gmbh/mautic-advanced-template...

New Features:

- Mautic v4
- The plugin now integrates also into pages and dynamic content and you can also use the last form submits of the user as tokens (syntax {{ form.. }} )

Example:

```auto
{% TWIG_BLOCK %}
{{ form.12.email }} 
{% END_TWIG_BLOCK %}

```

would echo the email field of the last form submit from form 12 of the lead

P.S: I’m sorry I have not found the time to document the features more and to make a pull request in the original plugin. But I wanted to take the chance and help 🙂

Greetings  
Sebastian

---

<div class="post-metadata">

**Author:** ![marcelszimonisz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/marcelszimonisz/32/14420_2.png) [@marcelszimonisz](https://forum.mautic.org/u/marcelszimonisz)\
**Post date:** [October 16, 2025, 6:32am UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/15 "2025-10-16T06:32:25Z")

</div>

Hello, is any of the plugins working on version 6? This should be native feature of mautic 🙂

---

<div class="post-metadata">

**Author:** ![chaoranxie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/chaoranxie/32/14680_2.png) [@chaoranxie](https://forum.mautic.org/u/chaoranxie)\
**Post date:** [December 9, 2025, 12:56pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/16 "2025-12-09T12:56:23Z")

</div>

Testing mautic 7, also hoping for some doc on how to enable twig using free plugin

---

<div class="post-metadata">

**Author:** ![ryonwhyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ryonwhyte/32/14702_2.png) [@ryonwhyte](https://forum.mautic.org/u/ryonwhyte)\
**Post date:** [December 18, 2025, 3:52am UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/17 "2025-12-18T03:52:51Z")

</div>

I had the same need and mautic and teh twig plugin does not seem to be compatible with mautic 6. I created a plugin [GitHub - ryonwhyte/MauticTwigEnhancements](https://github.com/ryonwhyte/MauticTwigEnhancements)

In case anyone comes across this and has the same issues you can test this out. Works great for me on mautic 6.

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [December 19, 2025, 1:41pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/18 "2025-12-19T13:41:43Z")

</div>

Hello Ryon

Such a great job you did! Many, many thanks for your work!  
I wanted to test it straight away, unpacked and copied the directory into the plugins folder, refreshed the installed plugins, but no Mautic Twig Enhancements avialable.  
I’m using Mautic 6.0.7 and PHP 8.2..

Kind regards

Christian

---

<div class="post-metadata">

**Author:** ![ryonwhyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ryonwhyte/32/14702_2.png) [@ryonwhyte](https://forum.mautic.org/u/ryonwhyte)\
**Post date:** [December 19, 2025, 3:40pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/19 "2025-12-19T15:40:41Z")

</div>

Hi @taxi

I had an issue like that.

1. Ensure the folder has the correct name “MauticTwigEnhancementsBundle
2. I kept running into a permission issue. The plugin folder was owned by root as I cloned the repo as root user. Then mautic could not access it so ensure the folder have the correct permission.

Clear the cache after install.

I also had a case where the plugin was active but did not show in the UI. I then realize my log file was owned by root and when activating the plugin there was a warning that tried to write to the log and failed. So the plugin was active and can be used but was not visible in the UI. This was caused my cron jobs running as root.

Try this command (I am running in docker you may need to adjust)

```auto
cd /var/www/html # or wherever Mautic is installed

php bin/console debug:container | grep -i twig

php bin/console debug:event-dispatcher EmailEvents::EMAIL_ON_SEND

```

Or if you need to run as the web server user:

`sudo -u www-data php bin/console debug:container | grep -i twig`

If you see entries like

```auto
mautic.twig_enhancements.twig_processor

mautic.twig_enhancements.email_subscriber

```

Then its active.

---

<div class="post-metadata">

**Author:** ![taxi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/taxi/32/522_2.png) [@taxi](https://forum.mautic.org/u/taxi)\
**Post date:** [December 20, 2025, 8:14pm UTC](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571/20 "2025-12-20T20:14:26Z")

</div>

Hi Ryon,

Many thanks for your quick help.

I tried the steps you suggested. No success yet.

php bin/console mautic:plugins:reload comes up with the following error:

In PluginUpdateEvent.php line 17:

Mautic\PluginBundle\Event\PluginUpdateEvent::\_\_construct(): Argument #3 ($metadata) must be of typ  
e array, null given, called in /var/www/clients/client1/web134/web/mautic/docroot/app/bundles/Plug  
inBundle/Helper/ReloadHelper.php on line 83

mautic:plugins:reload

[Next page](https://forum.mautic.org/t/mautic-twig-advanced-templates-bundle/26571.md?page=2)
