Class WebEngineWarningMail

java.lang.Object
com.iizix.server.webengine.WebEngineWarningMail

public final class WebEngineWarningMail extends Object
The warning mail of WebEngineHistory to the administrators (work order CC-WEBENGINE-STATS-V51, section (b)): the recipients are the enabled members of the group Administrators that have an address, except the seeded addresses nobody reads (EmailAddressForm.isSeededEmail(String)); the mail goes through the server's default mail sender, from its default sender address, as one mail with every recipient in BCC, so that no administrator sees the others' addresses. Plain text, English: a mail has no session whose language it could follow.

Nothing here decides WHEN to mail: that is the history's (one mail per application per day, the server setting $webEngine.warnMail). Without a mail sender, or without a recipient, nothing is sent and the history is told so (0 recipients), which is not an error.

Author:
Christopher Mindus
  • Method Details

    • recipients

      public static List<String> recipients(ConnectionSource connections) throws SQLException
      Finds the recipients: the addresses of the enabled administrators, seeded addresses left out.
      Parameters:
      connections - The connections.
      Returns:
      The addresses, possibly none.
      Throws:
      SQLException - For SQL errors.
    • send

      public static int send(MailSender sender, ConnectionSource connections, String subject, String text) throws SQLException, MessagingException
      Sends a warning to the administrators: one mail, every recipient in BCC, sent now through the sender given.
      Parameters:
      sender - The mail sender, null when the server has none configured.
      connections - The connections, for the recipients.
      subject - The subject.
      text - The plain text.
      Returns:
      The recipients the mail was sent to; 0 when there is no sender or nobody to send to.
      Throws:
      SQLException - If the recipients cannot be read.
      MessagingException - If the sender has no default sender address, or the mail is refused.