Either user entity post save listening for a state change in the user state field or an extension for the service class that handles email confirmation.
Either user entity post save listening for a state change in the user state field or an extension for the service class that handles email confirmation.
I made an entity save listener but how is it possible to detect that the user state went from email_confirm to valid when you only have the final entity?
Originally I implemented a preSave handler to add potential users to an array in addition to a postSave handler to access it, but it seems like the state for even a static class variable is not shared.
The default pre/post save methods of the user object have sample code for that in place I believe. If not, you can look into thread & post pre/post save