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
https://logicify.com/?utm_source=github&utm_campaign=mautic-templates&utm_medium=opensource
MIT License
86 stars 57 forks source link

Reusable code snippets/Dynamic content does not work in Mautic 4.4.10 #39

Open tacevski opened 6 months ago

tacevski commented 6 months ago

Trying to use dynamic content as per Example 3: Reusable code snippets using the following...

{% TWIG_BLOCK %} {{include('dc:test_content')}} {% END_TWIG_BLOCK %}

I get the error...

mautic.NOTICE: Swift_TransportException: Error while rendering part text: line 1: attempt to call non-existent macro 'include' (uncaught exception) at /var/www/mautic/app/bundles/EmailBundle/Swiftmailer/Transport/AbstractTokenArrayTransport.php line 291 while running console commandmautic:emails:send[]

IonutOjicaDE commented 1 month ago

Your code should be

{% TWIG_BLOCK %}{{ include('dc:test_content') }}{% END_TWIG_BLOCK %}

I added one space char after {{ and before }}. Twig is very strict regarding the spaces... Also the space before {{ and after }} : I suppose these will be printed out in the end - I removed them in the code above.