2

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).

checketts
  • 14,167
  • 10
  • 53
  • 82

1 Answers1

0

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} )]
checketts
  • 14,167
  • 10
  • 53
  • 82