To add to @Chatura Madhusanka's answer, please follow the below directory structure. The templates should be placed under src/resources/theme/{your-custom-templates} directory. Then, in the Keycloak Admin Console, you can select the template for the email as "your-custom-templates" under Realm Settings --> Email. This is verified with Keycloak 24 embedded in Spring Boot.
├───src
│ ├───main
│ │ ├───java
│ │ └───resources
│ │ │
│ │ ├───META-INF
│ │ │ │
│ │ │ └───keycloak-themes.json
│ │ │
│ │ └───theme
│ │ └───your-custom-templates
│ │ └───email
│ │ │ theme.properties
│ │ │
│ │ ├───html
│ │ │ executeActions.ftl
│ │ │
│ │ ├───messages
│ │ │ messages_en.properties
│ │ │
│ │ └───text
│ │ executeActions.ftl