Shopware 6 is an open commerce platform based on Symfony Framework and Vue and supported by a worldwide community and more than 1.500 community extensions
Twig variables don't get escaped after saving the header and footer E-Mail template and thus get interpreted as twig variables instead of being rendered as a string.
Actual behaviour
Curly braces of twig variables get escaped inside some HTML-tag attributes in header & footer E-Mail templates and thus do not get interpreted as twig variables but instead being rendered as a string.
How to reproduce
Create a new header and footer E-Mail template
Add the following HTML code to the HTML mail header and HTML mail footer textarea:
<img src="{{ salesChannel }}" alt="{{ salesChannel }}" /> <a href="{{ salesChannel }}" class="{{ salesChannel }}">{{ salesChannel }}</a>
Save
The HTML in both textareas will have been converted to the following:
<img src="%7B%7B%20salesChannel%20%7D%7D" alt="{{ salesChannel }}" /> <a href="%7B%7B%20salesChannel%20%7D%7D" class="{{ salesChannel }}">{{ salesChannel }}</a>
PHP Version
8.1
Shopware Version
6.5.3.0
Expected behaviour
Twig variables don't get escaped after saving the header and footer E-Mail template and thus get interpreted as twig variables instead of being rendered as a string.
Actual behaviour
Curly braces of twig variables get escaped inside some HTML-tag attributes in header & footer E-Mail templates and thus do not get interpreted as twig variables but instead being rendered as a string.
How to reproduce
<img src="{{ salesChannel }}" alt="{{ salesChannel }}" /> <a href="{{ salesChannel }}" class="{{ salesChannel }}">{{ salesChannel }}</a>
The HTML in both textareas will have been converted to the following:
<img src="%7B%7B%20salesChannel%20%7D%7D" alt="{{ salesChannel }}" /> <a href="%7B%7B%20salesChannel%20%7D%7D" class="{{ salesChannel }}">{{ salesChannel }}</a>