- NAME
- SYNOPSIS
- DESCRIPTION
- METHODS
  - CleanSlate
  - Commit
  - Prepare
  - To
  - Cc
  - Bcc
  - SendMessage MIMEObj
  - AddAttachments
  - AddAttachment $attachment
  - AttachTickets [@IDs]
  - AddTickets
  - AddTicket $ID
  - RecordOutgoingMailTransaction MIMEObj
  - SetRTSpecialHeaders
  - SquelchMailTo
  - RemoveInappropriateRecipients
  - SetReturnAddress is_comment => BOOLEAN
  - SetFrom ( From => emailaddress )
  - GetFriendlyName
  - SetHeader FIELD, VALUE
  - SetSubject
  - SetSubjectToken
  - SetReferencesHeaders
  - PseudoReference
  - SetHeaderAsEncoding($field_name, $charset_encoding)
  - MIMEEncodeString

# 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

## 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

## 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.

## 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.

## 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.

← Back to index