NAME

Notice - A placeholder class for notice-methods in the AURORA notification-service

SYNOPSIS

use Notice;

# create instance
my $n=Notice->new(host=>"oompaloompa");

# send a notice
$n->send("charliebucket193@yahoo.com","willy.wonka@wonka.chocolate","I Won!!","Hi\nPlease know that I have found one of the golden tickets.");

# get last error
print $n->error();

# get last result of send()-method
print $n->result();

DESCRIPTION

A placeholder class for notice-methods in the AURORA notification-service.

The class implements mainly the method send, which is to be overridden.

CONSTRUCTOR

new()

Instantiate class.

The method takes one input: server. This is just an example in the placeholder. This method is to be overridden by the inheriting class in order to define the necessary parameters to setup the Notice sending method properly.

Returns a class instance.

METHODS

send()

Attempts to send a notice through a service of some kind.

It accepts these input parameters in the following order:

Returns 1 upon success, 0 upon failure. Please check the error()-method for more information upon failure.

This method is to be overridden by the inheriting class. The format and use of the parameters from, to and subject is up to that class. The only requirement is that they are to be SCALAR.

result()

Returns the last result of the send command or a blank string.

This method will return a message both if the last send()-method invocation was successful or not. The result message can be blank if the inheriting class do not have any message to return.

It is the task of the inheriting class to set $self->{result} to the relevant message.

error()

Returns the last error that has happened (if any).

No input is accepted.