Refactoring postfix transport script to allow pluggable commands.
This commit is contained in:
parent
a735068f25
commit
37120bafa8
4 changed files with 184 additions and 35 deletions
27
lib/WebGUI/MailCommand/Subscribe.pm
Normal file
27
lib/WebGUI/MailCommand/Subscribe.pm
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue