webgui_newsletter/lib/WebGUI/MailCommand/Subscribe.pm

27 lines
571 B
Perl

package WebGUI::MailCommand::Subscribe;
use strict;
use warnings;
use WebGUI::AssetAspect::Subscriber;
use base 'WebGUI::MailCommand';
#-----------------------------------------------------------------------------
sub process {
my $self = shift;
my $listName= shift;
my $session = $self->session;
my $log = $session->log;
my $asset = WebGUI::AssetAspect::Subscriber::findAssetByListName( $session, $listName );
die "Invalid list name [$listName]" unless $asset;
$asset->subscribeThroughEmail( $fromAddress );
return;
}
1;