Interface Mail

All Superinterfaces:
BaseMail, Cloneable
All Known Implementing Classes:
AbstractOutgoingMail, DelegatingMail, IncaIncomeMail, IncaMail, MailImpl

public interface Mail extends BaseMail, Cloneable
  • Method Details Link icon

    • getSourceEntity Link icon

      @Nullable @Nullable Entity getSourceEntity()
    • setSourceEntity Link icon

      Mail setSourceEntity(@Nullable @Nullable Entity sourceEntity)
    • addSourceEntity Link icon

      Mail addSourceEntity(@Nullable @Nullable Entity sourceEntity)
    • getRelatedEntity Link icon

      @Nullable @Nullable Entity getRelatedEntity()
    • setRelatedEntity Link icon

      Mail setRelatedEntity(@Nullable @Nullable Entity relatedEntity)
    • getRecipientEntity Link icon

      @Nullable @Nullable Entity getRecipientEntity()
    • setRecipientEntity Link icon

      Mail setRecipientEntity(@Nullable @Nullable Entity recipientEntity)
    • addTo Link icon

      Mail addTo(MailReceiver receiver) throws jakarta.mail.MessagingException
      Add a receiver to "to", evaluating the right value according to the MailReceiver^s configuration.
      Parameters:
      receiver - the receiver
      Throws:
      jakarta.mail.MessagingException
    • addTo Link icon

      Mail addTo(Entity userEntity) throws jakarta.mail.MessagingException
      Add the address from a User entity to "to".
      Parameters:
      userEntity - Entity of type User
      Throws:
      jakarta.mail.MessagingException
    • addTo Link icon

      Mail addTo(EntityList userEntities) throws jakarta.mail.MessagingException
      Add addresses from User entities to "to".
      Parameters:
      userEntities - EntityList with entities of type User
      Throws:
      jakarta.mail.MessagingException
    • addCc Link icon

      Mail addCc(Entity userEntity) throws jakarta.mail.MessagingException
      Add the address from a User entity to "cc".
      Parameters:
      userEntity - Entity of type User
      Throws:
      jakarta.mail.MessagingException
    • addCc Link icon

      Mail addCc(EntityList userEntities) throws jakarta.mail.MessagingException
      Add addresses from User entities to "cc".
      Parameters:
      userEntities - EntityList with entities of type User
      Throws:
      jakarta.mail.MessagingException
    • addBcc Link icon

      Mail addBcc(Entity userEntity) throws jakarta.mail.MessagingException
      Add the address from a User entity to "bcc".
      Parameters:
      userEntity - Entity of type User
      Throws:
      jakarta.mail.MessagingException
    • addBcc Link icon

      Mail addBcc(EntityList userEntities) throws jakarta.mail.MessagingException
      Add addresses from User entities to "bcc".
      Parameters:
      userEntities - EntityList with entities of type User
      Throws:
      jakarta.mail.MessagingException
    • getContactCategory Link icon

      @Nullable @Nullable Entity getContactCategory()
    • setContactCategory Link icon

      Mail setContactCategory(@Nullable @Nullable Entity contactCategory)
    • getTemplateEntity Link icon

      @Nullable @Nullable Entity getTemplateEntity()
    • setTemplateEntity Link icon

      Mail setTemplateEntity(@Nullable @Nullable Entity templateEntity)
    • preventFromArchive Link icon

      Mail preventFromArchive(boolean preventFromArchive)
    • setTemplateAttribute Link icon

      Mail setTemplateAttribute(String name, Object value)
      Set a template attribute. If an attribute with the same name already exists it will be overriden. To set entity data into a variable use setTemplateEntityData(String, ch.tocco.nice2.persist.entity.Entity) and setTemplateEntityListData(String, ch.tocco.nice2.persist.entity.EntityList).
      Parameters:
      name - The name for the attribute.
      value - The value.
    • setTemplateEntityData Link icon

      Mail setTemplateEntityData(String name, Entity entity)
      Set an entity template attribute
      Parameters:
      name - the name for the attribute
      entity - the entity
    • setTemplateEntityListData Link icon

      Mail setTemplateEntityListData(String name, EntityList entityList)
      Set an entity list template attribute
      Parameters:
      name - the name for the attribute
      entityList - the entity list
    • getTemplateAttribute Link icon

      Optional<Object> getTemplateAttribute(String name)
      Get the value of a template attribute.
      Parameters:
      name - The name of the attribute to get.
      Returns:
      the value or Optional.empty() if it's not set.
    • getTemplateAttributes Link icon

      Map<String,Object> getTemplateAttributes()
      Get an unmodifiable map of all template attributes.
      Returns:
      an unmodifiable map of all attributes.
    • removeAttachment Link icon

      boolean removeAttachment(Attachment attachment)
      Specified by:
      removeAttachment in interface BaseMail
    • containsAttachment Link icon

      boolean containsAttachment(Attachment attachment)
      Specified by:
      containsAttachment in interface BaseMail
    • getAttributes Link icon

      Map<String,Object> getAttributes()
    • send Link icon

      void send() throws MailException
      Send the message.
      Throws:
      MailException
    • clone Link icon

      Throws:
      CloneNotSupportedException
    • setFrom Link icon

      Mail setFrom(Entity from) throws jakarta.mail.MessagingException
      Throws:
      jakarta.mail.MessagingException
    • getSender Link icon

      Entity getSender()
    • setSender Link icon

      Mail setSender(Entity sender)
    • setSingleCopyMail Link icon

      Mail setSingleCopyMail(boolean singleCopyMail)
      only relevant for the GUI MailAction (defaults to false), won't link the resulting MailArchive entity to the recipient but the User(s) with the email address in BaseMail.getCc().
      Parameters:
      singleCopyMail - true / false
    • isSingleCopyMail Link icon

      boolean isSingleCopyMail()
    • getExpiryDate Link icon

      org.joda.time.LocalDate getExpiryDate()
    • setExpiryDate Link icon

      Mail setExpiryDate(org.joda.time.LocalDate expiryDate)
    • getTaskUuid Link icon

      UUID getTaskUuid()
    • setTaskUuid Link icon

      Mail setTaskUuid(UUID taskUuid)
      Set the UUID which is needed to group the mails sent from the same task
      Parameters:
      taskUuid - a random uuid given from the task which sends the mail
    • getBody Link icon

      String getBody() throws MailException
      Throws:
      MailException
    • getMimeMessageHeaders Link icon

      Map<String,Iterable<String>> getMimeMessageHeaders() throws MailException, jakarta.mail.MessagingException
      Throws:
      MailException
      jakarta.mail.MessagingException
    • getMimeMessageFrom Link icon

      String getMimeMessageFrom() throws jakarta.mail.MessagingException, MailException
      Throws:
      jakarta.mail.MessagingException
      MailException
    • addMailListener Link icon

      void addMailListener(Mail.MailListener listener)
    • removeMailListener Link icon

      void removeMailListener(Mail.MailListener listener)