Interface Mail
- All Known Implementing Classes:
AbstractOutgoingMail
,DelegatingMail
,IncaIncomeMail
,IncaMail
,MailImpl
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface ch.tocco.nice2.messaging.mail.api.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".void
addMailListener
(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()
boolean
containsAttachment
(Attachment attachment) getBody()
@Nullable Entity
org.joda.time.LocalDate
@Nullable Entity
@Nullable Entity
@Nullable Entity
getTemplateAttribute
(String name) Get the value of a template attribute.Get an unmodifiable map of all template attributes.@Nullable Entity
boolean
preventFromArchive
(boolean preventFromArchive) boolean
removeAttachment
(Attachment attachment) void
removeMailListener
(Mail.MailListener listener) void
send()
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 theUUID
which 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 ch.tocco.nice2.messaging.mail.api.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
-
setSourceEntity
-
addSourceEntity
-
getRelatedEntity
-
setRelatedEntity
-
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
Add the address from a User entity to "to".- Parameters:
userEntity
- Entity of type User- Throws:
jakarta.mail.MessagingException
-
addTo
Add addresses from User entities to "to".- Parameters:
userEntities
- EntityList with entities of type User- Throws:
jakarta.mail.MessagingException
-
addCc
Add the address from a User entity to "cc".- Parameters:
userEntity
- Entity of type User- Throws:
jakarta.mail.MessagingException
-
addCc
Add addresses from User entities to "cc".- Parameters:
userEntities
- EntityList with entities of type User- Throws:
jakarta.mail.MessagingException
-
addBcc
Add the address from a User entity to "bcc".- Parameters:
userEntity
- Entity of type User- Throws:
jakarta.mail.MessagingException
-
addBcc
Add addresses from User entities to "bcc".- Parameters:
userEntities
- EntityList with entities of type User- Throws:
jakarta.mail.MessagingException
-
getContactCategory
-
setContactCategory
-
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
Set an entity template attribute- Parameters:
name
- the name for the attributeentity
- the entity
-
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
Get an unmodifiable map of all template attributes.- Returns:
- an unmodifiable map of all attributes.
-
removeAttachment
- Specified by:
removeAttachment
in interfaceBaseMail
-
containsAttachment
- Specified by:
containsAttachment
in interfaceBaseMail
-
getAttributes
-
send
Send the message.- Throws:
MailException
-
clone
- Throws:
CloneNotSupportedException
-
setFrom
- Throws:
jakarta.mail.MessagingException
-
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
Set theUUID
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
- Throws:
MailException
-
getMimeMessageHeaders
Map<String,Iterable<String>> getMimeMessageHeaders() throws MailException, jakarta.mail.MessagingException- Throws:
MailException
jakarta.mail.MessagingException
-
getMimeMessageFrom
- Throws:
jakarta.mail.MessagingException
MailException
-
addMailListener
-
removeMailListener
-