p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
Other
362 stars 65 forks source link

Unable to send email using quay.io/phasetwo/phasetwo-keycloak:22.0.4 image. #137

Closed patrickmichalina closed 8 months ago

patrickmichalina commented 8 months ago

Getting started with keycloak and using this "orgs" extended image. Email is failing though when I use this image instead of the base keycloak/keycloak:22.0.4 (which sends emails just fine). Any ideas?

java.lang.NullPointerException: Cannot invoke "org.keycloak.email.EmailTemplateProvider.sendSmtpTestEmail(java.util.Map, org.keycloak.models.UserModel)" because the return value of "org.keycloak.models.KeycloakSession.getProvider(java.lang.Class)" is null
    at org.keycloak.services.resources.admin.RealmAdminResource.testSMTPConnection(RealmAdminResource.java:998)
2023-10-21 16:06:22,388 ERROR [org.keycloak.services.resources.admin.RealmAdminResource] (executor-thread-16) Failed to send email 
xgp commented 8 months ago

Are you running it with the flags?

    --spi-email-template-provider=freemarker-plus-mustache --spi-email-template-freemarker-plus-mustache-enabled=true
patrickmichalina commented 8 months ago

@xgp that appears to have fixed it, thanks!