From ec4834090ddfc962a85fe36304d5cc1cd9ecd502 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Wed, 13 Oct 2010 17:55:27 +0200 Subject: [PATCH] Add (us)subscribe commands and pass sender address along. --- lib/WebGUI/MailCommand.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/MailCommand.pm b/lib/WebGUI/MailCommand.pm index e81f90f..a37aca1 100644 --- a/lib/WebGUI/MailCommand.pm +++ b/lib/WebGUI/MailCommand.pm @@ -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 };