aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/send-alerts25
-rwxr-xr-xbin/send-reports9
2 files changed, 6 insertions, 28 deletions
diff --git a/bin/send-alerts b/bin/send-alerts
index c52af4059..89dc18ee7 100755
--- a/bin/send-alerts
+++ b/bin/send-alerts
@@ -5,37 +5,18 @@
#
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
-#
-# $Id: send-alerts,v 1.5 2010-01-06 16:50:25 louise Exp $
use strict;
require 5.8.0;
use CGI; # XXX
-
-# Horrible boilerplate to set up appropriate library paths.
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
use CronFns;
use mySociety::Config;
-use mySociety::DBHandle qw(dbh);
-use FixMyStreet::Alert;
-
-BEGIN {
- mySociety::Config::set_file("$FindBin::Bin/../conf/general");
- mySociety::DBHandle::configure(
- Name => mySociety::Config::get('BCI_DB_NAME'),
- User => mySociety::Config::get('BCI_DB_USER'),
- Password => mySociety::Config::get('BCI_DB_PASS'),
- Host => mySociety::Config::get('BCI_DB_HOST', undef),
- Port => mySociety::Config::get('BCI_DB_PORT', undef)
- );
-}
+use FixMyStreet::App;
my $site = CronFns::site(mySociety::Config::get('BASE_URL'));
CronFns::language($site);
-my $testing_email = mySociety::Config::get('TESTING_EMAIL');
-FixMyStreet::Alert::email_alerts($testing_email);
+
+FixMyStreet::App->model('DB::AlertType')->email_alerts();
diff --git a/bin/send-reports b/bin/send-reports
index feee74c76..fbbd3db5e 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -192,14 +192,11 @@ while (my $row = $unsent->next) {
die 'Report not going anywhere for ID ' . $row->id . '!';
}
- my $testing_email = mySociety::Config::get('TESTING_EMAIL');
- if ($row->user->email eq $testing_email) {
- @recips = ( $testing_email );
- $send_web = 0;
- $send_email = 1;
- } elsif (mySociety::Config::get('STAGING_SITE')) {
+ if (mySociety::Config::get('STAGING_SITE')) {
# on a staging server send emails to ourselves rather than the councils
@recips = ( mySociety::Config::get('CONTACT_EMAIL') );
+ $send_web = 0;
+ $send_email = 1;
} elsif ($site eq 'emptyhomes') {
my $council = $row->council;
my $country = $areas_info->{$council}->{country};