Adding Unsubscribe command.
This commit is contained in:
parent
176becbfce
commit
14a1a03ba6
1 changed files with 27 additions and 0 deletions
27
lib/WebGUI/MailCommand/Unsubscribe.pm
Normal file
27
lib/WebGUI/MailCommand/Unsubscribe.pm
Normal 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;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue