aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-04-03 12:37:54 +0100
committerStruan Donald <struan@exo.org.uk>2012-04-03 12:37:54 +0100
commita16e71730cf86cd48773ffbd8390c65e1dc2fc6a (patch)
tree0f1f2064fb210e7a49796593f8fd6c4945a6a309 /perllib/FixMyStreet/SendReport.pm
parent05da714171febbfba2d65656ea8cf04115978b50 (diff)
use module::pluggable to get a list of avaible sending modules
skip on sending if the sending module isn't available
Diffstat (limited to 'perllib/FixMyStreet/SendReport.pm')
-rw-r--r--perllib/FixMyStreet/SendReport.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/SendReport.pm b/perllib/FixMyStreet/SendReport.pm
index f2ebdd3d7..84a89f877 100644
--- a/perllib/FixMyStreet/SendReport.pm
+++ b/perllib/FixMyStreet/SendReport.pm
@@ -2,9 +2,22 @@ package FixMyStreet::SendReport;
use Moose;
+use Module::Pluggable
+ sub_name => 'senders',
+ search_path => __PACKAGE__,
+ require => 1;
+
has 'councils' => (is => 'rw', isa => 'HashRef', default => sub { {} } );
has 'to' => (is => 'rw', isa => 'ArrayRef', default => sub { [] } );
+sub get_senders {
+ my $self = shift;
+
+ my %senders = map { $_ => 1 } $self->senders;
+
+ return \%senders;
+}
+
sub reset {
my $self = shift;