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

TWIG_BLOCK unknown #8

Closed leosuganob closed 2 years ago

leosuganob commented 4 years ago

Mautic Version: 2.15.1 PHP Version: 7.0.18

This seems working on Email Template creation through 'Code Mode' option. But when I tried to applied it on the theme that I created, it breaks. I got this error:

mautic.CRITICAL: Uncaught PHP Exception Twig_Error_Syntax: "Unknown "TWIG_BLOCK" tag." at /var/www/html/mautic/themes/hp-transactional/html/email.html.twig line 90 {"exception":"[object] (Twig_Error_Syntax(code: 0): Unknown \"TWIG_BLOCK\" tag. at /var/www/html/mautic/themes/hp-transactional/html/email.html.twig:90)"} []

benfavre commented 4 years ago

You have to create a template like this

{{ "{% TWIG_BLOCK %}" }}
{{ "{% set posts = 'https://xxx.yyy/feed' | rss %}" }}
.....
{{ "{% END_TWIG_BLOCK %}" }}
MarketSmart commented 2 years ago

Its likely the editor is breaking it by throwing html in the twig logic. I'll be closing this ticket for now but if the issue persists on the upcoming mautic 4 branch you can open a new issue.