RT 3.8.17 Documentation

RT::Attachment Overlay

Go to latest version →

SYNOPSIS

    use RT::Attachment;

DESCRIPTION

This module should never be instantiated directly by client code. it's an internal module which should only be instantiated through exported APIs in Ticket, Queue and other similar objects.

METHODS

Create

Create a new attachment. Takes a paramhash:

    'Attachment' Should be a single MIME body with optional subparts
    'Parent' is an optional id of the parent attachment
    'TransactionId' is the mandatory id of the transaction this attachment is associated with.;

Import

Create an attachment exactly as specified in the named parameters.

TransactionObj

Returns the transaction object asscoiated with this attachment.

ParentObj

Returns a parent's RT::Attachment object if this attachment has a parent, otherwise returns undef.

Children

Returns an RT::Attachments object which is preloaded with all attachments objects with this attachment\'s Id as their Parent.

Content

Returns the attachment's content. if it's base64 encoded, decode it before returning it.

OriginalContent

Returns the attachment's content as octets before RT's mangling. Currently, this just means restoring text content back to its original encoding.

OriginalEncoding

Returns the attachment's original encoding.

ContentLength

Returns length of "Content" in bytes.

Quote

ContentAsMIME

Returns MIME entity built from this attachment.

Addresses

Returns a hashref of all addresses related to this attachment. The keys of the hash are From, To, Cc, Bcc, RT-Send-Cc and RT-Send-Bcc. The values are references to lists of Email::Address objects.

NiceHeaders

Returns a multi-line string of the To, From, Cc, Date and Subject headers.

Headers

Returns this object's headers as a string. This method specifically removes the RT-Send-Bcc: header, so as to never reveal to whom RT sent a Bcc. We need to record the RT-Send-Cc and RT-Send-Bcc values so that we can actually send out mail. The mailing rules are separated from the ticket update code by an abstraction barrier that makes it impossible to pass this data directly.

EncodedHeaders

Takes encoding as argument and returns the attachment's headers as octets in encoded using the encoding.

This is not protection using quoted printable or base64 encoding.

GetHeader $TAG

Returns the value of the header Tag as a string. This bypasses the weeding out done in Headers() above.

DelHeader $TAG

Delete a field from the attachment's headers.

AddHeader $TAG, $VALUE, ...

Add one or many fields to the attachment's headers.

SetHeader ( 'Tag', 'Value' )

Replace or add a Header to the attachment's headers.

SplitHeaders

Returns an array of this attachment object's headers, with one header per array entry. Multiple lines are folded.

Never returns RT-Send-Bcc field.

_SplitHeaders

Returns an array of this attachment object's headers, with one header per array entry. multiple lines are folded.

_Value

Takes the name of a table column. Returns its value as a string, if the user passes an ACL check

← Back to index