Class IncaMailMessageFactory
java.lang.Object
ch.tocco.nice2.optional.incamail.impl.rest.IncaMailMessageFactory
Maps an
IncaMailBean and its attachments to the IncaMailRestClient.Message payload of the IncaMail
REST API. Subject, bodies and attachment contents have to be base64-encoded; the API states that
base64-encoded strings must not contain line breaks (CRLF or CR), hence
Base64.getEncoder() rather than the MIME encoder.
Regular attachments are uploaded beforehand with message/prepareFile and only referenced
by their UUID. Inline attachments stay MIME attachments, as only those can be referenced by
cid: in the html body.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IncaMailRestClient.MessagecreateMessage(IncaMailBean bean, Collection<Attachment> attachments, Charset charset, boolean encodeFileNames, Function<IncaMailRestClient.LargeFile, String> prepareFile)
-
Method Details
-
createMessage
public static IncaMailRestClient.Message createMessage(IncaMailBean bean, Collection<Attachment> attachments, Charset charset, boolean encodeFileNames, Function<IncaMailRestClient.LargeFile, String> prepareFile)
-