Skip to main content

Represents an attachment with additional methods for retrieving data and accessing the parent item.

Properties (12)

Property Type Default Required Description
data⚓︎ string x x

The attachment data, encoded as a base64 string.

emailIds⚓︎ T42Id[] x x

Optional id of the email owning the attachment. This field is only required when a T42Attachment value is used outside the context of the email that owns it.

errorMessage⚓︎ string x x

Error message if the attachment retrieval failed.

ids⚓︎ T42Id[] x x

Identifiers for the attachment, which is unique within a single email.

length⚓︎ number x x

The length of the current data chunk.

more⚓︎ boolean x x

Set to true if the data has been chunked and there are more chunks to be received.

name⚓︎ string x x

Display name for the attachment; typically a filename without a path. Therefore, neither the Helper nor the CRM should rely on identifying the attachment using this field.

parent⚓︎ Email | Task x

The parent email or task that owns the attachment.

sizeHint⚓︎ number x x

An estimate of the size of the attachment. This is an estimate of the size that the attachment would have if it were saved to disk. It is not the size of the encoded string (e.g. MIME) and it is an advisory-value only, to help with storage optimizations. Neither the Helper nor the CRM should rely on this field being present and 100% accurate in all cases (especially when the attachment may be encoded or encrypted In some way).

success⚓︎ boolean x x

Whether the attachment data was retrieved successfully.

totalLength⚓︎ number x x

The total length of the attachment data across all chunks.

1 Methods

getData()⚓︎

(callback?: (percent: number) => number) => Promise<string>

Returns attachment data as base64.

Parameters (1)

Name Type Required Description
callback⚓︎ (percent: number) => number x

A callback which will be called multiple times with the percent of progress.