aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorlouise <louise>2009-11-23 17:25:43 +0000
committerlouise <louise>2009-11-23 17:25:43 +0000
commitf8af48b80c43b0f9f87db5a390a8300469ef627f (patch)
tree9ee8ced09a71b2e24f137ff03b340b0a3f5ada6f /bin
parent075146ee0872ee0ff9e1b1c6fb84f7f5322cb7ba (diff)
Define which vhosts send cron emails for which cobrands
Diffstat (limited to 'bin')
-rwxr-xr-xbin/send-questionnaires3
-rwxr-xr-xbin/send-reports10
2 files changed, 10 insertions, 3 deletions
diff --git a/bin/send-questionnaires b/bin/send-questionnaires
index a3943c2cc..bb096fa22 100755
--- a/bin/send-questionnaires
+++ b/bin/send-questionnaires
@@ -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-questionnaires,v 1.19 2009-11-19 15:10:28 louise Exp $
+# $Id: send-questionnaires,v 1.20 2009-11-23 17:25:43 louise Exp $
use strict;
require 5.8.0;
@@ -63,6 +63,7 @@ foreach my $row (@$unsent) {
my $cobrand = $row->{cobrand};
my $lang = $row->{lang};
Cobrand::set_lang_and_domain($cobrand, $lang);
+ next unless (Cobrand::email_host($cobrand));
my ($councils, $missing) = $row->{council} =~ /^([\d,]+)(?:\|([\d,]+))?/;
my @councils = split /,/, $councils;
my $areas_info = mySociety::MaPit::get_voting_areas_info(\@all_councils);
diff --git a/bin/send-reports b/bin/send-reports
index 852f20987..12aeba5b0 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.74 2009-08-12 13:36:00 matthew Exp $
+# $Id: send-reports,v 1.75 2009-11-23 17:25:43 louise Exp $
use strict;
require 5.8.0;
@@ -21,6 +21,7 @@ use CGI; # Trying awkward kludge
use CronFns;
use EastHantsWSDL;
+use Cobrand;
use mySociety::Config;
use mySociety::DBHandle qw(dbh);
use mySociety::Email;
@@ -50,13 +51,18 @@ my $site = CronFns::site($base_url);
CronFns::language($site);
my $query = "SELECT id, council, category, title, detail, name, email, phone,
- used_map, easting, northing, (photo is not null) as has_photo, lang
+ used_map, easting, northing, (photo is not null) as has_photo, lang,
+ cobrand, cobrand_data
FROM problem WHERE state in ('confirmed','fixed') AND whensent IS NULL
AND council IS NOT NULL";
my $unsent = dbh()->selectall_arrayref($query, { Slice => {} });
my (%notgot, %note);
+my $cobrand;
foreach my $row (@$unsent) {
+
+ $cobrand = $row->{cobrand};
+ next unless (Cobrand::email_host($cobrand));
if (dbh()->selectrow_array('select email from abuse where lower(email)=?', {}, lc($row->{email}))) {
dbh()->do("update problem set state='hidden' where id=?", {}, $row->{id});