Interface Mail
- All Known Implementing Classes:
AbstractOutgoingMail, DelegatingMail, IncaIncomeMail, IncaMail, MailImpl
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface BaseMail
NO_SUBJECT -
Method Summary
Modifier and TypeMethodDescriptionAdd the address from a User entity to "bcc".addBcc(EntityList userEntities) Add addresses from User entities to "bcc".Add the address from a User entity to "cc".addCc(EntityList userEntities) Add addresses from User entities to "cc".voidaddMailListener(Mail.MailListener listener) addSourceEntity(@Nullable Entity sourceEntity) addTo(MailReceiver receiver) Add a receiver to "to", evaluating the right value according to theMailReceiver^s configuration.Add the address from a User entity to "to".addTo(EntityList userEntities) Add addresses from User entities to "to".clone()booleancontainsAttachment(Attachment attachment) getBody()@Nullable Entityorg.joda.time.LocalDate@Nullable Entity@Nullable Entity@Nullable EntitygetTemplateAttribute(String name) Get the value of a template attribute.Get an unmodifiable map of all template attributes.@Nullable EntitybooleanpreventFromArchive(boolean preventFromArchive) booleanremoveAttachment(Attachment attachment) voidremoveMailListener(Mail.MailListener listener) voidsend()Send the message.setContactCategory(@Nullable Entity contactCategory) setExpiryDate(org.joda.time.LocalDate expiryDate) setRecipientEntity(@Nullable Entity recipientEntity) setRelatedEntity(@Nullable Entity relatedEntity) 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 inBaseMail.getCc().setSourceEntity(@Nullable Entity sourceEntity) setTaskUuid(UUID taskUuid) Set theUUIDwhich is needed to group the mails sent from the same tasksetTemplateAttribute(String name, Object value) Set a template attribute.setTemplateEntity(@Nullable Entity templateEntity) setTemplateEntityData(String name, Entity entity) Set an entity template attributesetTemplateEntityListData(String name, EntityList entityList) Set an entity list template attributeMethods inherited from interface BaseMail
addAttachment, addBcc, addBcc, addBcc, addCc, addCc, addCc, addReplyTo, addReplyTo, addReplyTo, addTo, addTo, addTo, clearAttachments, clearBcc, clearCc, clearReplyTo, clearTo, createAttachment, createAttachment, createAttachment, getAttachments, getBcc, getCc, getFrom, getHtml, getReplyTo, getSubject, getText, getTo, hasNoRecipients, isBodyEmpty, setFrom, setHtml, setSubject, setText
-
Method Details
-
getSourceEntity
@Nullable Entity getSourceEntity() -
setSourceEntity
-
addSourceEntity
-
getRelatedEntity
@Nullable Entity getRelatedEntity() -
setRelatedEntity
-
getRecipientEntity
@Nullable Entity getRecipientEntity() -
setRecipientEntity
-
addTo
Add a receiver to "to", evaluating the right value according to theMailReceiver^s configuration.- Parameters:
receiver- the receiver- Throws:
jakarta.mail.MessagingException
-
addTo
-
addTo
Add addresses from User entities to "to".- Parameters:
userEntities- EntityList with entities of type User- Throws:
jakarta.mail.MessagingException
-
addCc
-
addCc
Add addresses from User entities to "cc".- Parameters:
userEntities- EntityList with entities of type User- Throws:
jakarta.mail.MessagingException
-
addBcc
-
addBcc
Add addresses from User entities to "bcc".- Parameters:
userEntities- EntityList with entities of type User- Throws:
jakarta.mail.MessagingException
-
getContactCategory
@Nullable Entity getContactCategory() -
setContactCategory
-
getTemplateEntity
@Nullable Entity getTemplateEntity() -
setTemplateEntity
-
preventFromArchive
-
setTemplateAttribute
Set a template attribute. If an attribute with the same name already exists it will be overriden. To set entity data into a variable usesetTemplateEntityData(String, ch.tocco.nice2.persist.entity.Entity)andsetTemplateEntityListData(String, ch.tocco.nice2.persist.entity.EntityList).- Parameters:
name- The name for the attribute.value- The value.
-
setTemplateEntityData
-
setTemplateEntityListData
Set an entity list template attribute- Parameters:
name- the name for the attributeentityList- the entity list
-
getTemplateAttribute
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
-
removeAttachment
- Specified by:
removeAttachmentin interfaceBaseMail
-
containsAttachment
- Specified by:
containsAttachmentin interfaceBaseMail
-
getAttributes
-
send
-
clone
- Throws:
CloneNotSupportedException
-
setFrom
-
getSender
Entity getSender() -
setSender
-
setSingleCopyMail
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 inBaseMail.getCc().- Parameters:
singleCopyMail- true / false
-
isSingleCopyMail
boolean isSingleCopyMail() -
getExpiryDate
org.joda.time.LocalDate getExpiryDate() -
setExpiryDate
-
getTaskUuid
UUID getTaskUuid() -
setTaskUuid
-
getBody
- Throws:
MailException
-
getMimeMessageHeaders
Map<String, Iterable<String>> getMimeMessageHeaders() throws MailException, jakarta.mail.MessagingException- Throws:
MailExceptionjakarta.mail.MessagingException
-
getMimeMessageFrom
- Throws:
jakarta.mail.MessagingExceptionMailException
-
addMailListener
-
removeMailListener
-