Class VerificationMails

java.lang.Object
com.iizix.server.user.VerificationMails

public final class VerificationMails extends Object
The verification mail of a user's registered address, on the user's request (CC-FIX-SIGNIN-ACCOUNT-MAIL: "Resend" of S10 and of Account, the administrator's address of S32): the one engine behind IUserAuthenticationUI.resendVerificationMail, so that its outcome is what the screen says.

It creates the verification when none is pending. An address is pending when the user's details hold IZS-Email and IZS-EmailVerify with a code below 3 (BasicUserInfo.getMailsToVerify()). An address written without them - by SQL, by an older path - had nothing to send and "Resend" answered "sent" all the same (the lab's "no IZS-EmailVerify detail: nothing to send"). Now the two details are written first, in their own transaction, and the mail goes.

The outcome follows the relay. The mail is handed to the delivery step given - the production step sends NOW, bounded (MailDelivery.SEND_NOW) - and the result says what happened: sent, no address, verified already, no mail relay configured, no base for the link, or refused by the relay, with the reason in plain words for the log; the screen's texts are the SignIn module's. Nothing here is answered as sent that was not.

The link is the caller's (ServerShell.getEmailVerificationURL on the client session's origin, MailLinkBase, R-145); no log line carries the full address (EmailAddressForm.masked(String)).

Author:
Christopher Mindus
  • Method Details

    • send

      public static VerificationMails.Result send(BasicUserInfo bui, MailSender sender, Function<String,String> link, AccountEmailChange.IMailStep deliver, long now)
      Sends the verification mail of the user's registered address: creates the pending verification when none is, builds the link, hands the mail to the delivery step and tells what happened. Never throws; one log line.
      Parameters:
      bui - The user, read from the database.
      sender - The mail sender, null for none configured.
      link - Makes the sealed verification link of the address, null when none can be made.
      deliver - The delivery step: MailDelivery.SEND_NOW in production.
      now - The current time, for the detail written.
      Returns:
      The result.
      Throws:
      NullPointerException - If the user or the delivery step is null.