Devdocs: Space in Custom Directive code does not work on Email Templates

Created on 19 Feb 2020  路  3Comments  路  Source: magento/devdocs

Description:

The example of a new directive does not work in an upgraded 2.3.4 Magento.

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/templates/template-email-migration.html

Possible solutions:

Either a part of the description is missing or the code should be made to work. I personally have not been able to make this work.

Additional information:

I have created a directive, a copy of the code here but in a different namespace.
When I add the directive to the template as a core change, to test if it works, the directive is not replaced.
If I place spaces between the curly braces and the name of the directive I get a notice "Undefined index: directiveName in vendor/magento/framework/Filter/DirectiveProcessor/SimpleDirective.php on line 68"

Technical

Most helpful comment

@lenlorijn I've just had the same issue after upgrading to 2.3.4, and after some debugging it all resolved to template directives having spaces inside of curly braces, e.g.:
<div>{{ name }}</div>
should be replaced with:
<div>{{name}}</div>.

All 3 comments

@lenlorijn I've just had the same issue after upgrading to 2.3.4, and after some debugging it all resolved to template directives having spaces inside of curly braces, e.g.:
<div>{{ name }}</div>
should be replaced with:
<div>{{name}}</div>.

@nathanjosiah

error filtering template: notice: undefined index: directivename in vendor/magento/framework/filter/directiveprocessor/simpledirective.php on line 68
Hi Dear, i felt same error but i solved it 100%. please check email template in marketing in the admin, if any commented code or unused space please remove. you will get 100% solution.

Was this page helpful?
0 / 5 - 0 ratings