diff options
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index dec204b1c..404622e9c 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -59,11 +59,14 @@ sub send { my @recips = $self->build_recipient_list( $row, $h ); # on a staging server send emails to ourselves rather than the councils - if (mySociety::Config::get('STAGING_SITE')) { + if (mySociety::Config::get('STAGING_SITE') && !FixMyStreet->test_mode) { @recips = ( mySociety::Config::get('CONTACT_EMAIL') ); } - return unless @recips; + unless ( @recips ) { + $self->error( 'No recipients' ); + return 1; + } my ($verbose, $nomail) = CronFns::options(); my $result = FixMyStreet::App->send_email_cron( |