Interface OttDelivery

All Known Implementing Classes:
ThymeleafOttMailer

public interface OttDelivery
Port that delivers a one-time token to a destination through a channel.
  • Method Details

    • deliverCode

      void deliverCode(OttChannel channel, String destination, String code, Duration validFor)
      Delivers a numeric code.
      Parameters:
      channel - channel to use.
      destination - e-mail address or E.164 phone number, according to the channel.
      code - the code in clear text.
      validFor - how long the code stays valid, shown to the user.
      Throws:
      OttDeliveryException - if the code could not be delivered.
    • deliverLink

      void deliverLink(OttChannel channel, String destination, URI link, Duration validFor)
      Delivers a magic link.
      Parameters:
      channel - channel to use.
      destination - e-mail address or E.164 phone number, according to the channel.
      link - the link that opens the confirmation page.
      validFor - how long the link stays valid, shown to the user.
      Throws:
      OttDeliveryException - if the link could not be delivered.