An attachment specification for an email job. Every email the job generates has these attachments resolved and added to it. The file is identified either by a path within the live branch of a repository, or by a content hash in the hash store together with the filename to present it under.

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
attachmentFilenameStringThe filename to present the attachment under when it is identified by hash, since the hash store holds content without a name. Only meaningful when an attachment hash is set.
attachmentHashStringIf present, the hash which locates the file content in the hash store. This pins the attachment to one fixed version of the file, unlike a repository path.
baseEmailJobBaseEmailJobThe email job whose generated emails carry this attachment. Never null.
contentTypeStringMedia type to declare for the attachment, for example a PDF or image type. Null when it was not recorded, in which case the type is worked out from the file itself.
filePathStringIf present, the path to the file to attach within the live branch of the repository. Used instead of the attachment hash, and the file is read fresh each time an email is generated so changes to it are picked up.
idlongDatabase identifier for this attachment specification, assigned when the row is first saved.
repositoryRepositoryThe repository whose live branch the file path is resolved against. Null when the attachment is identified by hash rather than by path.

Methods

getId()

Returns: long

Database identifier for this attachment specification, assigned when the row is first saved.

getBaseEmailJob()

Returns: BaseEmailJob

The email job whose generated emails carry this attachment. Never null.

getContentType()

Returns: String

Media type to declare for the attachment, for example a PDF or image type. Null when it was not recorded, in which case the type is worked out from the file itself.

getFilePath()

Returns: String

If present, the path to the file to attach within the live branch of the repository. Used instead of the attachment hash, and the file is read fresh each time an email is generated so changes to it are picked up.

getAttachmentHash()

Returns: String

If present, the hash which locates the file content in the hash store. This pins the attachment to one fixed version of the file, unlike a repository path.

getAttachmentFilename()

Returns: String

The filename to present the attachment under when it is identified by hash, since the hash store holds content without a name. Only meaningful when an attachment hash is set.

getRepository()

Returns: Repository

The repository whose live branch the file path is resolved against. Null when the attachment is identified by hash rather than by path.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.