Adding Unsubscribe command.

This commit is contained in:
Martin Kamerbeek 2010-10-13 18:03:39 +02:00
parent 176becbfce
commit 14a1a03ba6

View file

@ -0,0 +1,27 @@
package WebGUI::MailCommand::Unsubscribe;
use strict;
use warnings;
use WebGUI::AssetAspect::Subscriber;
use base 'WebGUI::MailCommand';
#-----------------------------------------------------------------------------
sub process {
my $self = shift;
my $listName = shift;
my $fromAddress = shift;
my $session = $self->session;
my $asset = WebGUI::AssetAspect::Subscriber->getAssetByListName( $session, $listName );
die "Invalid list name [$listName]" unless $asset;
$asset->unsubscribeAnonymous( $fromAddress );
return;
}
1;