Getting TemplateNotFoundException at email template running on Red Hat Build of Keycloak 22

Solution Verified - Updated -

Issue

I am getting the following error on my custom email template configuration:

Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "html/template.ftl".
The name was interpreted by this TemplateLoader: org.keycloak.theme.freemarker.DefaultFreeMarkerProvider$ThemeTemplateLoader@218e03cc.
    at freemarker.template.Configuration.getTemplate(Configuration.java:2957)
    at freemarker.core.Environment.getTemplateForInclusion(Environment.java:3062)
    at freemarker.core.Environment.getTemplateForInclusion(Environment.java:3024)
    at freemarker.core.Environment.getTemplateForImporting(Environment.java:3186)
    at freemarker.core.Environment.importLib(Environment.java:3171)
    at freemarker.core.Environment.importLib(Environment.java:3135)
    at freemarker.core.LibraryLoad.accept(LibraryLoad.java:65)
    ... 51 more
2024-04-16 16:34:31,144 ERROR [org.keycloak.services.resources.admin.RealmAdminResource] (executor-thread-35) Failed to send email 

My email template folder looks like:

.
├── html
│   └── email-test.ftl
├── text
│   └── email-test.ftl

Environment

  • Red Hat build of Keycloak - 22.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content