<div dir="ltr"><span style="font-size:12.8px">Hi everybody,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">    Has anyone managed to configure Keycloak 2.0.0.Final to use a transactional email API instead of configuring an SMTP server? I would prefer to have Keycloak send emails using a rest API like Sendgrid, Mandrill, Mailgun or Amazon SES (the cloud-native way) instead of running an SMTP server.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">   I&#39;d also appreciate if this is possible through the SPI providers.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">   * Should I implement both EmailSenderProvider and EmailTemplateProvider SPIs ?</div><div style="font-size:12.8px">   * I cannot get my custom EmailSenderProvider SPI implementation to work, as the FreemarkerEmailTemplateProvider implementation fails to obtain the implementation of the EmailSenderProvider. Stack trace is below</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div><span style="white-space:pre-wrap">        </span>13:17:53,991 ERROR [org.keycloak.forms.login.freemarker.FreeMarkerLoginFormsProvider] (default task-39) Failed to send verification email: org.keycloak.email.EmailException: Failed to template email</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:179)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:150)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.sendVerifyEmail(FreeMarkerEmailTemplateProvider.java:146)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.forms.login.freemarker.FreeMarkerLoginFormsProvider.createResponse(FreeMarkerLoginFormsProvider.java:156)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.authentication.requiredactions.VerifyEmail.requiredActionChallenge(VerifyEmail.java:73)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.services.managers.AuthenticationManager.executionActions(AuthenticationManager.java:559)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.services.managers.AuthenticationManager.actionRequired(AuthenticationManager.java:490)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.services.managers.AuthenticationManager.nextActionAfterAuthentication(AuthenticationManager.java:412)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.services.resources.LoginActionsService$Checks.verifyRequiredAction(LoginActionsService.java:299)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.services.resources.LoginActionsService.processRequireAction(LoginActionsService.java:853)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.services.resources.LoginActionsService.requiredActionGET(LoginActionsService.java:846)</div><div><span style="white-space:pre-wrap">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span style="white-space:pre-wrap">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</div><div><span style="white-space:pre-wrap">        </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span style="white-space:pre-wrap">        </span>at java.lang.reflect.Method.invoke(Method.java:498)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:138)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:101)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)</div><div><span style="white-space:pre-wrap">        </span>at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)</div><div><span style="white-space:pre-wrap">        </span>at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:90)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)</div><div><span style="white-space:pre-wrap">        </span>at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div><div><span style="white-space:pre-wrap">        </span>at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)</div><div><span style="white-space:pre-wrap">        </span>at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)</div><div><span style="white-space:pre-wrap">        </span>at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)</div><div><span style="white-space:pre-wrap">        </span>at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)</div><div><span style="white-space:pre-wrap">        </span>at java.lang.Thread.run(Thread.java:745)</div><div>Caused by: java.lang.NullPointerException</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:185)</div><div><span style="white-space:pre-wrap">        </span>at org.keycloak.email.freemarker.FreeMarkerEmailTemplateProvider.send(FreeMarkerEmailTemplateProvider.java:177)</div><div><span style="white-space:pre-wrap">        </span>... 57 more</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thanks,</div><div style="font-size:12.8px">Vineet</div></div>