Bric::Dist::Action::Email

NAME

Bric::Dist::Action::Email - Class to email distribution resources

VITALS

SYNOPSIS

use Bric::Dist::Action::Email;

my $id = 1; # Assume that this is an Email action.
# This line will automatically instantiate the correct subclass.
my $action = Bric::Dist::Action->lookup({ id => $id });

# Set up the action.
$action->set_from('me@example.com');
$action->set_to('you@example.net');

# Perform the action on a list of resources.
$action = $action->do_it($resources_href);

# Undo is a no-op.
$action = $action->undo_it($resources_href);

DESCRIPTION

This subclass of Bric::Dist::Action can be used to email distribution resources to one or more email addresses.

CLASS INTERFACE

Constructors

See Bric::Dist::Action.

Class Methods

The following class method is in addition to those provided by Bric::Dist::Action, and overrides the same method in that class.

has_more

if (Bric::Dist::Action::Email->has_more) {
    print "It has more attributes than Bric::Dist::Action\n";
}

Returns true to indicate that this action has more properties than does the base class (Bric::Dist::Action).

my_meths

my $meths = Bric::Dist::Action::Email->my_meths
my @meths = Bric::Dist::Action::Email->my_meths(1);
my $meths_aref = Bric::Dist::Action::Email->my_meths(1);
@meths = Bric::Dist::Action::Email->my_meths(0, 1);
$meths_aref = Bric::Dist::Action::Email->my_meths(0, 1);

Returns Bric::Dist::Action::Email attribute accessor introspection data. See Bric for complete documentation of the format of that data. Returns accessor introspection data for the following attributes:

INSTANCE INTERFACE

Accessors

The following accessors are in addition to those provided by Bric::Dist::Action.

from

my $from = $action->get_from;
$action = $action->set_from($from);

Get and set the address from which email will be sent. Optional. The setter converts non-Unix line endings.

to

my $to = $action->get_to;
$action = $action->set_to($to);

Get and set the address or addresses to which email will be sent. Multiple addresses should be separated by commas. Either to or bcc or both are required. The setter converts non-Unix line endings.

cc

my $cc = $action->get_cc;
$action = $action->set_cc($cc);

Get and set the address or addresses to which email will be Cc'd. Multiple addresses should be separated by commas. Optional. The setter converts non-Unix line endings.

bcc

my $bcc = $action->get_bcc;
$action = $action->set_bcc($bcc);

Get and set the address or addresses to which email will be Bcc'd. Multiple addresses should be separated by commas. Either to or bcc or both are required. The setter converts non-Unix line endings.

subject

my $subject = $action->get_subject;
$action = $action->set_subject($subject);

Get and set the subject to be used when emails are sent. Optional. The setter converts non-Unix line endings.

content_type

my $content_type = $action->get_content_type;
$action = $action->set_content_type($content_type);

Get and set the content type to be used when emails are sent. If not specified, Bric::Dist::Action::Email will use the media type of the first text file it uses for the email message. The setter converts non-Unix line endings.

handle_text

my $handle_text = $action->get_handle_text;
$action = $action->set_handle_text($handle_text);

Get and set the constant value that determines how text resources are handled. All files with a media type starting with "text/" are considered text files. The possible values for this attribute are available via the constants defined for this class:

The setter converts non-Unix line endings.

handle_other

my $handle_other = $action->get_handle_other;
$action = $action->set_handle_other($handle_other);

Get and set the contant value that deterimines how non-text resources, such as image files, are handled. All files with a media type that does not start with "text/" are considered non-text files. The possible values for this attribute are available via the constants defined for this class:

The setter converts non-Unix line endings.

Other Instance Methods

do_it

$action = $action->do_it($job, $server_type);

Emails the resources (files) for a given job and server type.

Thows:

save

$action = $action->save;

Saves the action for the server type and job, along with all of its attributes.

Thows:

AUTHOR

David Wheeler

SEE ALSO