Notice
- A placeholder class for notice-methods in the AURORA notification-service
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();
A placeholder class for notice-methods in the AURORA notification-service.
The class implements mainly the method send, which is to be overridden.
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.
Attempts to send a notice through a service of some kind.
It accepts these input parameters in the following order:
from Denotes who the notice is from. This is to be in the format of the Notice-class that implements this method. It can also be ignored if that is relevant to the inheriting class.
to Denotes who the notice is to be sent to. The receivers address in a format relevant to the Notice-class in question.
subject This is the subject of the notice being sent. This field can be ignored if that is relevant to the inheriting class (eg. SMS).
notice This is the notice to send to the receiver.
threadid The thread id to use for the notice being sent, if possible (not all message transports support this). SCALAR. Optional.
threadids Previous thread ids used for reference if usable. LIST-reference. Optional. Empty will be created by default.
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.
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.
Returns the last error that has happened (if any).
No input is accepted.