Class AccountMails

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

public final class AccountMails extends Object
The mails about an account's e-mail address and password that are not a password reset (PasswordResetMail): the verification mail of an address and the confirmation link of a change of address the user asked for (CC-ACCOUNT-EMAIL-PASSWORD, AE-3 and SE-1), and the frame of the notices AccountNotices composes - among them, since CC-FIX-SERVERADMIN-SD18-SD3 (SD-D-3), the notice to the old address of a changed address and the notice of a password an administrator set (AE-5), which were English-only texts here. Every mail is addressed from the sender's default sender address to the one address given and to nobody else; no mail carries a password. Nothing is sent here: the caller queues or sends.
Author:
Christopher Mindus
  • Field Details

  • Method Details

    • compose

      public static Mail compose(MailSender sender, String email, String subject) throws MessagingException
      Addresses a mail: from the sender's default sender address, to the one address given, the subject set, no text yet.
      Parameters:
      sender - The mail sender.
      email - The address of the user.
      subject - The subject.
      Returns:
      The addressed mail.
      Throws:
      MessagingException - If the sender has no default sender address, or the address does not parse.
    • verification

      public static Mail verification(MailSender sender, String email, String link) throws MessagingException
      The verification mail of a registered address: the text of the sign-up's, the address and the link filled in.
      Parameters:
      sender - The mail sender.
      email - The address to verify.
      link - The sealed verification link.
      Returns:
      The mail, ready to queue.
      Throws:
      MessagingException - As compose(MailSender, String, String).
    • changeLinkBody

      public static String changeLinkBody(String userName, String link)
      The text of the confirmation mail of a change of address the user asked for. The link is the only secret in it; the mail names the user so that a stranger's request is recognisable.
      Parameters:
      userName - The user name.
      link - The sealed verification link of the new address.
      Returns:
      The plain text.
    • changeLink

      public static Mail changeLink(MailSender sender, String newEmail, String userName, String link) throws MessagingException
      The confirmation mail of a change of address the user asked for, to the NEW address.
      Parameters:
      sender - The mail sender.
      newEmail - The new address.
      userName - The user name.
      link - The sealed verification link of the new address.
      Returns:
      The mail, ready to queue.
      Throws:
      MessagingException - As compose(MailSender, String, String).
    • accountNotice

      public static Mail accountNotice(MailSender sender, String email, String subject, String text) throws MessagingException
      A notice about a change to the account, composed by AccountNotices: the subject and the text as given, in the user's language; no secret in either.
      Parameters:
      sender - The mail sender.
      email - The address of the user.
      subject - The subject.
      text - The plain text.
      Returns:
      The mail, ready to queue.
      Throws:
      MessagingException - As compose(MailSender, String, String).