public interface MessageTemplate
Set the message properties like subject, body, recipients using the setter methods. The message is sent with the send method.
Modifier and Type | Method and Description |
---|---|
MessageTemplate |
addAttachment(javax.mail.BodyPart mbp)
Add an attachment to the message
|
MessageTemplate |
addHeader(java.lang.String key,
java.lang.String value)
Add a header field to the message.
|
MessageTemplate |
addInlineBodyPart(javax.mail.BodyPart mbp)
Add an inline attachment to the mail (optionally).
|
MessageTemplate |
addRecipient(Recipient rec)
Add one recipients.
|
MessageTemplate |
addRecipient(java.lang.String email)
Add an email address as recipient.
|
MessageTemplate |
addRecipient(User user)
Add a user as recipient.
|
MessageTemplate |
addRecipients(java.util.List<Recipient> recs)
Add a list of recipients.
|
MessageTemplate |
clearRecipients(javax.mail.Message.RecipientType type)
Remove all recipients of the given type from the message.
|
java.lang.String |
getBody()
Get the message body
|
java.lang.String |
getDescription()
Get the description of the template.
|
java.lang.String |
getId()
Get the id of the template.
|
com.groiss.mail.MailQueueItem |
getMailQueueItem()
Returns a
MailQueueItem which could be set after sending mail |
javax.mail.Message |
getMessage()
Get the last java.mail.Message object sent by this MessageTemplate instance.
|
java.lang.String |
getMessageCharset()
Get the character set of the message
|
java.lang.String |
getMimeType()
Get the mime type
|
java.lang.String |
getName()
Get the name of the template.
|
java.lang.String |
getReplyTo()
Get the optional Reply-to header
|
java.lang.String |
getReplyToMsgId()
Get the optional In-Reply-To header (the message-id of the replying mail)
|
java.lang.String |
getSubject()
Get the message subject.
|
boolean |
isActive()
Is the template active
|
boolean |
isAddedToProcess()
Returns true if the mail message is added to the process
|
boolean |
isLogged()
Returns true if the message is logged in the mail journal
|
boolean |
send()
Send the message.
|
MessageTemplate |
setActive(boolean active)
Set the message template to active.
|
MessageTemplate |
setActivityInstance(ActivityInstance ai)
Set the message context (used for template replacements) to the given activity instance.
|
MessageTemplate |
setAddToProcess(boolean add)
Add the message to the process.
|
MessageTemplate |
setBody(java.lang.String body)
Set the message body.
|
MessageTemplate |
setBodyUrl(java.lang.String url)
Set the message body.
|
MessageTemplate |
setDocument(DMSObject doc)
Set the message context (used for template replacements) to the given document.
|
MessageTemplate |
setLocale(java.util.Locale l)
Set the locale that is used for internationalization of the message.
|
MessageTemplate |
setLogged(boolean l)
Log the message into the mail journal.
|
MessageTemplate |
setMailSender(MailSender ms)
Set the mail sender for using specific properties for sender and communication settings.
|
MessageTemplate |
setMessageCharset(java.lang.String charset)
Set the character set for the message (optionally).
|
MessageTemplate |
setMimeType(java.lang.String mimetype)
Set the mime-type.
|
MessageTemplate |
setProcessInstance(ProcessInstance pi)
Set the message context (used for template replacements) to the given process instance.
|
MessageTemplate |
setQueueAction(MailSender.MailAction ma)
Set the queue behavior.
|
MessageTemplate |
setReplace(boolean b)
Call with true, if you want that replacements are done in subject and body.
|
MessageTemplate |
setReplyTo(java.lang.String replyto)
Set the Reply-to header
|
MessageTemplate |
setReplyToMsgId(java.lang.String replyto_msgid)
Set the In-Reply-To header (the message-id of the replying mail)
|
MessageTemplate |
setSubject(java.lang.String subject)
Set the message subject.
|
MessageTemplate |
setVariableValue(java.lang.String key,
java.lang.Object value)
Define a variable for template substitution.
|
MessageTemplate setActive(boolean active)
MessageTemplate setMimeType(java.lang.String mimetype)
mimetype
- text/plain or text/html, the latter is the default.MessageTemplate setSubject(java.lang.String subject)
MessageTemplate setBody(java.lang.String body)
MessageTemplate setBodyUrl(java.lang.String url)
url
- the url points to a resource in the classpathMessageTemplate addRecipients(java.util.List<Recipient> recs)
MessageTemplate addRecipient(Recipient rec)
MessageTemplate addRecipient(User user)
MessageTemplate addRecipient(java.lang.String email)
MessageTemplate clearRecipients(javax.mail.Message.RecipientType type)
java.lang.String getReplyTo()
MessageTemplate setReplyTo(java.lang.String replyto)
java.lang.String getReplyToMsgId()
MessageTemplate addHeader(java.lang.String key, java.lang.String value)
MessageTemplate setReplyToMsgId(java.lang.String replyto_msgid)
java.lang.String getMessageCharset()
MessageTemplate setMessageCharset(java.lang.String charset)
MessageTemplate setLogged(boolean l)
MessageTemplate setAddToProcess(boolean add)
MessageTemplate setProcessInstance(ProcessInstance pi)
MessageTemplate setActivityInstance(ActivityInstance ai)
MessageTemplate setDocument(DMSObject doc)
MessageTemplate setVariableValue(java.lang.String key, java.lang.Object value)
key
- a key for referencing the objectvalue
- the value, can be a string, number, date, persistent, etc.MessageTemplate setLocale(java.util.Locale l)
MessageTemplate addAttachment(javax.mail.BodyPart mbp)
MessageTemplate addInlineBodyPart(javax.mail.BodyPart mbp)
MessageTemplate setQueueAction(MailSender.MailAction ma)
ma
- one of the mail action values: QUEUE, DEFFERRED, NO_QUEUEMessageTemplate setMailSender(MailSender ms)
com.groiss.mail.MailQueueItem getMailQueueItem()
MailQueueItem
which could be set after sending mailMailQueueItem
, otherwise null
javax.mail.Message getMessage()
MessageTemplate setReplace(boolean b)
b
- boolean send()
true
, if mail could be sent or false
, if mail could not be sent or
if mail has been inserted into mail queue. In all other cases an Exception is thrown.java.lang.String getId()
java.lang.String getName()
java.lang.String getDescription()
java.lang.String getSubject()
java.lang.String getBody()
java.lang.String getMimeType()
boolean isActive()
boolean isLogged()
boolean isAddedToProcess()
@enterprise 9.0.33982 Copyright © 2001-2023 Groiss Informatics GmbH. All Rights Reserved.