Skip to content

Instantly share code, notes, and snippets.

@theboreddev
Created October 10, 2022 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theboreddev/6026276d42d5f6cf4cc388d62593de40 to your computer and use it in GitHub Desktop.
Save theboreddev/6026276d42d5f6cf4cc388d62593de40 to your computer and use it in GitHub Desktop.
With registration email command
fun create(user: User): User {
return withinTransaction {
val savedUser = userRepository.save(user)
eventsEngine.send(UserCreated(UUID.randomUUID().toString(), user))
eventsEngine.send(SendRegistrationEmailEvent(UUID.randomUUID().toString(), user))
User.create(savedUser)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment