package WebGUI::Content::NewsletterManager; use strict; use warnings; use WebGUI::Pluggable; sub handler { my $session = shift; my $form = $session->form; my $module = $form->get('newsletter') || return; my $class = $module eq 'manage' ? 'WebGUI::Mailing::Admin' : $module eq 'mailing' ? 'WebGUI::Mailing' : $module eq 'bounce' ? 'WebGUI::Mailing::Bounce' : return ; my $func = 'www_' . ( $form->get('func') || 'view' ); my $id = $form->get('id'); my $object = eval { WebGUI::Pluggable::instanciate( $class, 'new', [ $session, $id ] ) }; if ( $@ || !$object ) { my $ac = WebGUI::AdminConsole->new( $session ); my $output = "Unable to instanciate object of class [$class] with id [$id] because: $@"; return $ac->render( $output, 'Error' ); }; return $object->$func if $object->can( $func ); return; } 1;