RT 4.2.17 Documentation

RT::Action::SendEmail

Go to latest version →

NAME

RT::Action::SendEmail - An Action which users can use to send mail or can subclassed for more specialized mail sending behavior. RT::Action::AutoReply is a good example subclass.

SYNOPSIS

  use base 'RT::Action::SendEmail';

DESCRIPTION

Basically, you create another module RT::Action::YourAction which ISA RT::Action::SendEmail.

METHODS

CleanSlate

Cleans class-wide options, like "AttachTickets".

Commit

Sends the prepared message and writes outgoing record into DB if the feature is activated in the config.

Prepare

Builds an outgoing email we're going to send using scrip's template.

To

Returns an array of Email::Address objects containing all the To: recipients for this notification

Cc

Returns an array of Email::Address objects containing all the Cc: recipients for this notification

Bcc

Returns an array of Email::Address objects containing all the Bcc: recipients for this notification

SendMessage MIMEObj

sends the message using RT's preferred API. TODO: Break this out to a separate module

AttachableFromTransaction

Function (not method) that takes an RT::Transaction and returns an RT::Attachments collection of attachments suitable for attaching to an email.

AddAttachments

Takes any attachments to this transaction and attaches them to the message we're building.

AddAttachment $attachment

Takes one attachment object of RT::Attachment class and attaches it to the message we're building.

AttachTickets [@IDs]

Returns or set list of ticket's IDs that should be attached to an outgoing message.

Note this method works as a class method and setup things global, so you have to clean list by passing undef as argument.

AddTickets

Attaches tickets to the current message, list of tickets' ids get from "AttachTickets" method.

AddTicket $ID

Attaches a ticket with ID to the message.

Each ticket is attached as multipart entity and all its messages and attachments are attached as sub entities in order of creation, but only if transaction type is Create or Correspond.

RecordOutgoingMailTransaction MIMEObj

Record a transaction in RT with this outgoing message for future record-keeping purposes

SetRTSpecialHeaders

This routine adds all the random headers that RT wants in a mail message that don't matter much to anybody else.

SquelchMailTo

Returns list of the addresses to squelch on this transaction.

RemoveInappropriateRecipients

Remove addresses that are RT addresses or that are on this transaction's blacklist

RecipientFilter Callback => SUB, [All => 1]

Registers a filter to be applied to addresses by RemoveInappropriateRecipients. The Callback will be called with one address at a time, and should return false if the address should receive mail, or a message explaining why it should not be. Passing a true value for All will cause the filter to also be applied to NoSquelch (one-time Cc and Bcc) recipients as well.

SetReturnAddress is_comment => BOOLEAN

Calculate and set From and Reply-To headers based on the is_comment flag.

SetFrom ( From => emailaddress )

Set the From: address for outgoing email

GetFriendlyName

Calculate the proper Friendly Name based on the creator of the transaction

SetHeader FIELD, VALUE

Set the FIELD of the current MIME object into VALUE, which should be in characters, not bytes. Returns the new header, in bytes.

SetSubject

This routine sets the subject. it does not add the rt tag. That gets done elsewhere If subject is already defined via template, it uses that. otherwise, it tries to get the transaction's subject.

SetSubjectToken

This routine fixes the RT tag in the subject. It's unlikely that you want to overwrite this.

SetReferencesHeaders

Set References and In-Reply-To headers for this message.

PseudoReference

Returns a fake Message-ID: header for the ticket to allow a base level of threading

SetHeaderAsEncoding($field_name, $charset_encoding)

This routine converts the field into specified charset encoding, then applies the MIME-Header transfer encoding.

MIMEEncodeString

Takes a perl string and optional encoding pass it over "EncodeToMIME" in RT::Interface::Email.

Basicly encode a string using B encoding according to RFC2047, returning bytes.

← Back to index