'How to use Thymeleaf layout dialect with Textual Syntax?
I'm trying to use the layout:decorate directive with a text file (plain text email header/footer)
Template begin called:
[# layout:decorate="~{email/plainPart}" th:with="subject=${subject}" ]
[# layout:fragment="content"]
Thanks for ordering [( ${orderDetail} )].
[/]
[/]
Layout template:
Subject: [( ${subject} )]
[# layout:fragment="content"][/]
The temple renders fine, and without any errors, but I'm not seeing any of the layout template (Subject, for example).
Solution 1:[1]
I've been unable to get layout:decorate to work. But based on a Stack Overflow answer about th:replace, I've been able to come up with a sort of solution:
Template:
[#th:block th:replace="email/plainPart.txt"][/th:block]
Thanks for ordering [( ${orderDetail} )].
plainPart.txt:
[( ${subject} )]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | checketts |
