Extract Attachments
Use the following method to extract and store attachments from the attachment script:
The resulting Attachment object contains the ID you need to inject back into the message. For more information, look at the User API. The return value for the JavaScript attachment script should be the final message string, with any attachments extracted out and replaced with attachment replacement tokens.
addAttachment(data, type)
Creates and stores an attachment for the current message.
Name | Type | Description |
---|---|---|
data | String or Byte array | The actual attachment data to insert. Man be either a String or a byte array. If a string is used, it is assumed to be a Base64 encoded representation of the actual attachment data. |
type | String | The MIME type of the attachment. For additional information see Attachment Handlers. |
<Return Value> | Attachment | The inserted Attachment object. |