Interface EmailAddressResolver

All Known Implementing Classes:
EmailVerificationService

public interface EmailAddressResolver

Says where a user's mail goes. A user record here has a name and no address, so the flows that send mail ask this.

@Bean
EmailAddressResolver addresses(AccountRepository accounts) {
    return username -> accounts.findByUsername(username).getEmail();
}
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The user name itself where it is an address, as it is in an application whose users sign in with one; nothing otherwise.
  • Method Summary

    Modifier and Type
    Method
    Description
    emailFor(String username)
    The address mail for username is sent to, or null when there is none and nothing should be sent.
  • Field Details

    • USERNAME

      static final EmailAddressResolver USERNAME
      The user name itself where it is an address, as it is in an application whose users sign in with one; nothing otherwise.
  • Method Details

    • emailFor

      String emailFor(String username)
      The address mail for username is sent to, or null when there is none and nothing should be sent.