Nim*_*hra 5 css java spring thymeleaf
我正在使用 spring thymeleaf 开发电子邮件模板。我需要在我的模板中包含对 MS-outlook [if mso] 的检查。我需要在块内设置一个变量。我想知道是否有办法做到这一点。
<!--[if mso]><p style="line-height:0;margin:0;"> </p><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" th:href="@{|${baseUrl}/#/signup?email=${registrationRequest.email}&key=${registrationRequest.registrationToken}|}" style="width:124px" arcsize="8%" strokecolor="#339561" filled="t"><v:fill type="gradient" angle="180" color="#44C781" color2="#3AA96E"></v:fill><v:textbox style="mso-fit-shape-to-text:t" inset="0px,11px,0px,11px"><center style="font-size:14px;line-height:24px;color:#FFFFFF;font-family:Tahoma,sans-serif;font-weight:bold;mso-line-height-rule:exactly;mso-text-raise:4px">Register</center></v:textbox></v:roundrect><![endif]-->
Run Code Online (Sandbox Code Playgroud)
我通过将整个 [if mso] 块移动到服务器端来解决这个问题。我附加了所需的变量并使用以下命令在模板中渲染了该块
<div th:remove="tag" th:utext="${msoTemplate}"></div>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1184 次 |
| 最近记录: |