Class SendMail
- java.lang.Object
-
- org.nuxeo.ecm.automation.core.operations.notification.SendMail
-
public class SendMail extends Object
Save the session - TODO remove this?- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanasHtmlprotected StringListbccprotected StringListblobXpathprotected StringListccstatic ComposerCOMPOSERDeprecated.since 11.1 due to its static modifier, it messes up tests, instantiateComposerinsteadprotected OperationContextctxprotected Stringfromstatic StringIDprotected booleanisStrictprotected static Loglogprotected javax.mail.SessionmailSessionprotected Stringmessageprotected StringListreplytoprotected booleanrollbackOnErrorprotected Stringsubjectprotected StringListtoprotected StringviewId
-
Constructor Summary
Constructors Constructor Description SendMail()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMailBoxInfo(Mailer.Message msg, Map<String,Object> map)protected voidaddMailBoxInfoInMessageHeader(Mailer.Message msg, Mailer.Message.AS as, List<MailBox> persons)protected StringcreateDocUrlWithToken(String documentUrl, String token)protected Mailer.MessagecreateMessage(DocumentModel doc, String message, Map<String,Object> map)protected voidgetBlob(Object o, List<Blob> blobs)protected StringgetContent()DocumentModelrun(DocumentModel doc)protected voidsend(DocumentModel doc)
-
-
-
Field Detail
-
log
protected static final Log log
-
COMPOSER
@Deprecated(since="11.1") public static final Composer COMPOSER
Deprecated.since 11.1 due to its static modifier, it messes up tests, instantiateComposerinstead
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
ctx
protected OperationContext ctx
-
from
protected String from
-
to
protected StringList to
-
mailSession
protected javax.mail.Session mailSession
-
cc
protected StringList cc
- Since:
- 5.9.1
-
bcc
protected StringList bcc
- Since:
- 5.9.1
-
replyto
protected StringList replyto
- Since:
- 5.9.1
-
subject
protected String subject
-
message
protected String message
-
asHtml
protected boolean asHtml
-
blobXpath
protected StringList blobXpath
-
rollbackOnError
protected boolean rollbackOnError
-
isStrict
protected boolean isStrict
- Since:
- 5.9.1
-
viewId
protected String viewId
-
-
Method Detail
-
run
public DocumentModel run(DocumentModel doc) throws freemarker.template.TemplateException, RenderingException, OperationException, javax.mail.MessagingException, IOException
- Throws:
freemarker.template.TemplateExceptionRenderingExceptionOperationExceptionjavax.mail.MessagingExceptionIOException
-
getContent
protected String getContent() throws OperationException, IOException
- Throws:
OperationExceptionIOException
-
send
protected void send(DocumentModel doc) throws freemarker.template.TemplateException, RenderingException, OperationException, javax.mail.MessagingException, IOException
- Throws:
freemarker.template.TemplateExceptionRenderingExceptionOperationExceptionjavax.mail.MessagingExceptionIOException
-
addMailBoxInfo
protected void addMailBoxInfo(Mailer.Message msg, Map<String,Object> map) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException- Since:
- 5.9.1
-
addMailBoxInfoInMessageHeader
protected void addMailBoxInfoInMessageHeader(Mailer.Message msg, Mailer.Message.AS as, List<MailBox> persons) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException- Since:
- 5.9.1
-
createMessage
protected Mailer.Message createMessage(DocumentModel doc, String message, Map<String,Object> map) throws javax.mail.MessagingException, freemarker.template.TemplateException, RenderingException, IOException
- Throws:
javax.mail.MessagingExceptionfreemarker.template.TemplateExceptionRenderingExceptionIOException
-
-