Keycloak的FreeMarker电子邮件模板 [英] Keycloak's FreeMarker email template

查看:340
本文介绍了Keycloak的FreeMarker电子邮件模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Keycloak发送忘记密码的电子邮件,从我在他们的文档和FreeMarker文档上所读的内容来看,似乎我应该能够使用HTML标记就好了.但是,当我在password-rest.ftl文件中使用它们时,它会像这样渲染整个标签:

I'm using Keycloak to send a forgot password email, and from what I've read on their docs and the FreeMarker docs, it seems like I should be able to use HTML tags just fine. However, when I use them in the password-rest.ftl file, it renders the whole tag like so:

<p>Some Text</p>

不仅仅是显示:一些文本

instead of just showing: Some Text

我找到了这个( https://issues.jboss.org/browse/KEYCLOAK-681 )说Keycloak只能发送纯文本电子邮件,我只是想看看是否有人能确定,因为我发现了一些看起来像HTML标记的东西应该可以使用

I found this (https://issues.jboss.org/browse/KEYCLOAK-681) saying that Keycloak can only send plain text emails, and I just wanted to see if anyone knew for sure since I have found some stuff that looks like the HTML tags should be usable How do you block emails from appearing as links in FreeMarker?

任何对此的建议或想法,将不胜感激.

Any advice or thoughts on this would be greatly appreciated.

推荐答案

有两个包含电子邮件模板的子目录.它们分别称为texthtml.当您需要HTML时,需要编辑位于html目录中的模板.

There are two sub-directories containing templates for emails. They are called text and html. When you want HTML you need to edit templates located in html directory.

Keycloak 本身以多部分消息的形式发送电子邮件,其中包含纯文本 HTML 版本-电子邮件客户端决定显示哪一个.

Keycloak itself sends emails as multi-part messages containing both plain-text and HTML versions - email client decides which one is displayed.

这篇关于Keycloak的FreeMarker电子邮件模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆