Refactoring postfix transport script to allow pluggable commands.

This commit is contained in:
Martin Kamerbeek 2010-10-13 10:31:52 +02:00
parent a735068f25
commit 37120bafa8
4 changed files with 184 additions and 35 deletions

View 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;