Class AccountMails
java.lang.Object
com.iizix.server.user.AccountMails
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe subject of the confirmation mail of a change of address the user asked for.static final intHow long the links ofverification(MailSender, String, String)andchangeLink(MailSender, String, String, String)are valid, for the texts: 72 hours (EmailVerificationLink.VALIDITY_MS).static final StringThe text of the verification mail:${email}and${url}are filled in (verification(MailSender, String, String), andBasicUserInfo.sendMailsToUnverifiedMailAddresses).static final StringThe subject of the verification mail of a registered address (the sign-up's since L-10a-1).Method Summary
Modifier and TypeMethodDescriptionstatic MailaccountNotice(MailSender sender, String email, String subject, String text) A notice about a change to the account, composed byAccountNotices: the subject and the text as given, in the user's language; no secret in either.static MailchangeLink(MailSender sender, String newEmail, String userName, String link) The confirmation mail of a change of address the user asked for, to the NEW address.static StringchangeLinkBody(String userName, String link) The text of the confirmation mail of a change of address the user asked for.static Mailcompose(MailSender sender, String email, String subject) Addresses a mail: from the sender's default sender address, to the one address given, the subject set, no text yet.static Mailverification(MailSender sender, String email, String link) The verification mail of a registered address: the text of the sign-up's, the address and the link filled in.
Field Details
VERIFY_SUBJECT
The subject of the verification mail of a registered address (the sign-up's since L-10a-1).- See Also:
VERIFY_MESSAGE
The text of the verification mail:${email}and${url}are filled in (verification(MailSender, String, String), andBasicUserInfo.sendMailsToUnverifiedMailAddresses).- See Also:
CHANGE_SUBJECT
The subject of the confirmation mail of a change of address the user asked for.- See Also:
LINK_HOURS
public static final int LINK_HOURSHow long the links ofverification(MailSender, String, String)andchangeLink(MailSender, String, String, String)are valid, for the texts: 72 hours (EmailVerificationLink.VALIDITY_MS).- See Also:
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- Ascompose(MailSender, String, String).
changeLinkBody
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- Ascompose(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 byAccountNotices: 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- Ascompose(MailSender, String, String).