Customized welcome email with update password link

We need to send customized email to new users added to our platform and include the link that lets them set their password - the same link that would be trigger when calling the /admin/realms/{realm_name}/users/{user_id}/execute-actions-email endpoint with UPDATE_PASSWORD in the body. I have looked at a couple of options, but none of them seem to be solving my problem in the way I would prefer.

  • I first looked into overwriting the exectue-actions-email template, but realized I would still prefer to keep the current template for users who need to reset their password when they forget their password, the only set of users I would like to receive the customized email is the new users that don’t already have credentials on file.
  • I then looked into custom event listener, at first glance listening to Admin Events of resource type Users and operation type Create would solve my problem, and I was able to get a lot of information I need in my email from the event, but I am struggling to see a way to produce the link for the user to update their password.

I’m still going through Keycloak’s code base to see how to do this, but would appreciate if anyone has any tips. Thanks!