Event Listener Module email not working as expected

Hi,

under Keycloak 12.0.2 I activated default “email” event listener for a realm with successful configured email settings. Triggering UPDATE_PASSWORD events of an enabled user with a verified email does not lead to a sent mail.
So I packed the org/keycloak/events/email/EmailEventListenerProvider and Factory class as a jar and deployed it as a new module. But again no success. With some debug outputs I could see, that the event is received in the Provider class (method onEvent ) and is added to the list of events of instance of EventListenerTransaction ( tx.addEvent(event)) .
Do I have to configure something in special to use this new form of transactional event processing, that they are being processed ?
If I use old Provider implementation code from Keycloak 11 where

emailTemplateProvider.setRealm(realm).setUser(user).sendEvent(event);

is invoked synchronously in onEvent method everything works fine and I get an email.

If someone has an idea, it would great to here it :-). Does someone has is successfully running with Keycloak 12 or later ?

Best regards !

Hi,

I’m having the same behaviour with keycloak 12.0.3.

" With some debug outputs I could see, that the event is received in the Provider class (method onEvent ) and is added to the list of events of instance of EventListenerTransaction ( tx.addEvent(event) ) ."

→ the sendEvent() method is never called…

Is it a known bug?

Cheers

Answering to myself :slight_smile:

I found that there is a bug fix in keycloak 14.0 in the class EmailEventListenerProvider.java

I ported the fix to my own event email provider and it is working now.

Cheers
Olivier