Add (us)subscribe commands and pass sender address along.

This commit is contained in:
Martin Kamerbeek 2010-10-13 17:55:27 +02:00
parent 98ce48f827
commit 831f3ef17a

View file

@ -24,13 +24,14 @@ sub processCommand {
my $session = shift;
my $command = shift;
my $parameter = shift;
my $sender = shift;
my $commandClass = resolveCommandClass( $command )
|| return;
my $commandObject = WebGUI::Pluggable::instanciate( $commandClass, 'new', [ $session ] );
return $commandObject->process( $parameter );
return $commandObject->process( $parameter, $sender );
}
sub session {
@ -42,7 +43,9 @@ sub resolveCommandClass {
# TODO: Do not hard code.
my %commands = (
bounce => 'WebGUI::MailCommand::Bounce',
unsubscribe => 'WebGUI::MailCommand::Unsubscribe',
subscribe => 'WebGUI::MailCommand::Subscribe',
bounce => 'WebGUI::MailCommand::Bounce',
);
return $commands{ $command } if exists $commands{ $command };