Class IncaMailMessageFactory

java.lang.Object
ch.tocco.nice2.optional.incamail.impl.rest.IncaMailMessageFactory

public abstract class IncaMailMessageFactory extends Object
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.