aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/send-alerts35
-rwxr-xr-xbin/send-reports4
2 files changed, 37 insertions, 2 deletions
diff --git a/bin/send-alerts b/bin/send-alerts
new file mode 100755
index 000000000..a9ccb8dba
--- /dev/null
+++ b/bin/send-alerts
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+# send-alerts:
+# Email alerts for Neighbourhood Fix-It
+#
+# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
+# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
+#
+# $Id: send-alerts,v 1.1 2007-01-26 01:01:22 matthew Exp $
+
+use strict;
+require 5.8.0;
+
+# Horrible boilerplate to set up appropriate library paths.
+use FindBin;
+use lib "$FindBin::Bin/../perllib";
+use lib "$FindBin::Bin/../../perllib";
+
+use mySociety::Config;
+use mySociety::DBHandle qw(dbh);
+use mySociety::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)
+ );
+}
+
+mySociety::Alert::email_alerts();
+
diff --git a/bin/send-reports b/bin/send-reports
index 853b35b25..17ec5692c 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: send-reports,v 1.1 2007-01-20 00:51:49 matthew Exp $
+# $Id: send-reports,v 1.2 2007-01-26 01:01:22 matthew Exp $
use strict;
require 5.8.0;
@@ -53,7 +53,7 @@ foreach my $row (@$unsent) {
my $email = mySociety::Email::construct_email({
_template_ => $template,
_parameters_ => \%h,
- From => [mySociety::Config::get('CONTACT_EMAIL'), 'Neighbourhood Fix-It'],
+ From => [mySociety::Config::get('CONTACT_EMAIL'), 'Neighbourhood Fix-It'],
To => [[$council_email, $area_info->{name}]],
});