aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templates/emails/alert-confirm2
-rw-r--r--templates/emails/alert-problem2
-rw-r--r--templates/emails/alert-problem-area2
-rw-r--r--templates/emails/alert-problem-council2
-rw-r--r--templates/emails/alert-problem-nearby2
-rw-r--r--templates/emails/alert-problem-ward2
-rw-r--r--templates/emails/alert-update2
-rw-r--r--templates/emails/empty property-confirm2
-rw-r--r--templates/emails/flickr-confirm2
-rw-r--r--templates/emails/flickr-submit2
-rw-r--r--templates/emails/problem-confirm2
-rw-r--r--templates/emails/questionnaire2
-rw-r--r--templates/emails/tms-confirm2
-rwxr-xr-xweb/confirm.cgi46
-rwxr-xr-xweb/faq.cgi10
-rwxr-xr-xweb/index.cgi8
16 files changed, 55 insertions, 35 deletions
diff --git a/templates/emails/alert-confirm b/templates/emails/alert-confirm
index bfa163fcc..bb6288119 100644
--- a/templates/emails/alert-confirm
+++ b/templates/emails/alert-confirm
@@ -10,5 +10,5 @@ asked to subscribe to on FixMyStreet:
If you can't click the link, please copy and paste it to the
address bar of your web browser.
-Yours,
+Yours,
The FixMyStreet team
diff --git a/templates/emails/alert-problem b/templates/emails/alert-problem
index 3d389a99b..8369b8e28 100644
--- a/templates/emails/alert-problem
+++ b/templates/emails/alert-problem
@@ -4,7 +4,7 @@ The following new problems have been added:
<?=$values['data']?>
---
+Yours,
The FixMyStreet team
To stop receiving emails when there are new problems,
diff --git a/templates/emails/alert-problem-area b/templates/emails/alert-problem-area
index 7cf193143..8c41aaf5e 100644
--- a/templates/emails/alert-problem-area
+++ b/templates/emails/alert-problem-area
@@ -5,7 +5,7 @@ The following new problems have been added within
<?=$values['data']?>
---
+Yours,
The FixMyStreet team
To stop receiving emails when there are new problems in
diff --git a/templates/emails/alert-problem-council b/templates/emails/alert-problem-council
index fc6c38f86..572e057a6 100644
--- a/templates/emails/alert-problem-council
+++ b/templates/emails/alert-problem-council
@@ -4,7 +4,7 @@ The following new problems have been reported to <?=$values['area_name']?>:
<?=$values['data']?>
---
+Yours,
The FixMyStreet team
To stop receiving emails when there are new problems reported to
diff --git a/templates/emails/alert-problem-nearby b/templates/emails/alert-problem-nearby
index 85136a034..0bf8483a7 100644
--- a/templates/emails/alert-problem-nearby
+++ b/templates/emails/alert-problem-nearby
@@ -4,7 +4,7 @@ The following nearby problems have been added:
<?=$values['data']?>
---
+Yours,
The FixMyStreet team
To stop receiving emails when there are nearby problems,
diff --git a/templates/emails/alert-problem-ward b/templates/emails/alert-problem-ward
index 75475061a..efcf15993 100644
--- a/templates/emails/alert-problem-ward
+++ b/templates/emails/alert-problem-ward
@@ -5,7 +5,7 @@ within <?=$values['ward_name']?>:
<?=$values['data']?>
---
+Yours,
The FixMyStreet team
To stop receiving emails when there are new problems reported to
diff --git a/templates/emails/alert-update b/templates/emails/alert-update
index bed854db5..bf69067f2 100644
--- a/templates/emails/alert-update
+++ b/templates/emails/alert-update
@@ -6,7 +6,7 @@ The following updates have been left on this problem:
View or reply to these updates: <?=$values['problem_url']?>
---
+Yours,
The FixMyStreet team
To stop receiving emails when there are new updates on this problem,
diff --git a/templates/emails/empty property-confirm b/templates/emails/empty property-confirm
index 14885490d..001afb355 100644
--- a/templates/emails/empty property-confirm
+++ b/templates/emails/empty property-confirm
@@ -16,5 +16,5 @@ Your report had the subject:
And details:
<?=$values['detail']?>
-Yours,
+Yours,
The Empty Homes Agency team
diff --git a/templates/emails/flickr-confirm b/templates/emails/flickr-confirm
index f07f53404..45d11a28a 100644
--- a/templates/emails/flickr-confirm
+++ b/templates/emails/flickr-confirm
@@ -10,5 +10,5 @@ you just gave to FixMyStreet:
This is so we can look up the photos you tag with FixMyStreet,
and send you an email letting you know about your new problems.
---
+Yours,
The FixMyStreet team
diff --git a/templates/emails/flickr-submit b/templates/emails/flickr-submit
index 348f4476f..f7eb1e99b 100644
--- a/templates/emails/flickr-submit
+++ b/templates/emails/flickr-submit
@@ -10,5 +10,5 @@ please visit the following URL:
Then we can send your photo to the council. Thanks!
---
+Yours,
The FixMyStreet team
diff --git a/templates/emails/problem-confirm b/templates/emails/problem-confirm
index 8d03ba91b..2a00e54a5 100644
--- a/templates/emails/problem-confirm
+++ b/templates/emails/problem-confirm
@@ -16,5 +16,5 @@ Your problem had the title:
And details:
<?=$values['detail']?>
-Yours,
+Yours,
The FixMyStreet team
diff --git a/templates/emails/questionnaire b/templates/emails/questionnaire
index 617acc3d8..4be8eeaa4 100644
--- a/templates/emails/questionnaire
+++ b/templates/emails/questionnaire
@@ -13,7 +13,7 @@ updating the status of your problem:
Please do not reply to this email; there is a public comment
box on the questionnaire.
-Yours,
+Yours,
The FixMyStreet team
Your problem was as follows:
diff --git a/templates/emails/tms-confirm b/templates/emails/tms-confirm
index e3eb5b431..4821aed82 100644
--- a/templates/emails/tms-confirm
+++ b/templates/emails/tms-confirm
@@ -10,5 +10,5 @@ interest in TextMyStreet:
If you can't click the link, please copy and paste it to the
address bar of your web browser.
-Yours,
+Yours,
The FixMyStreet team
diff --git a/web/confirm.cgi b/web/confirm.cgi
index 179b38fdb..d9e4c83ef 100755
--- a/web/confirm.cgi
+++ b/web/confirm.cgi
@@ -6,12 +6,13 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: confirm.cgi,v 1.40 2008-05-21 15:48:07 matthew Exp $
+# $Id: confirm.cgi,v 1.41 2008-09-17 16:55:58 matthew Exp $
use strict;
use Standard;
use Digest::SHA1 qw(sha1_hex);
use CrossSell;
+use mySociety::Alert;
use mySociety::AuthToken;
use mySociety::Random qw(random_bytes);
@@ -23,15 +24,15 @@ sub main {
my $token = $q->param('token');
my $type = $q->param('type') || '';
my $tokentype = $type eq 'questionnaire' ? 'update' : $type;
- my $id = mySociety::AuthToken::retrieve($tokentype, $token);
- if ($id) {
+ my $data = mySociety::AuthToken::retrieve($tokentype, $token);
+ if ($data) {
if ($type eq 'update') {
- $out = confirm_update($q, $id);
+ $out = confirm_update($q, $data);
} elsif ($type eq 'problem') {
- $out = confirm_problem($q, $id);
+ $out = confirm_problem($q, $data);
$extra = 'added-problem';
} elsif ($type eq 'questionnaire') {
- $out = add_questionnaire($q, $id, $token);
+ $out = add_questionnaire($q, $data, $token);
}
dbh()->commit();
} else {
@@ -49,13 +50,18 @@ EOF
Page::do_fastcgi(\&main);
sub confirm_update {
- my ($q, $id) = @_;
+ my ($q, $data) = @_;
+
+ my $id = $data->{id};
+ my $add_alert = $data->{add_alert};
+
#if (dbh()->selectrow_array('select email from abuse where lower(email)=?', {}, lc($email))) {
# dbh()->do("update comment set state='hidden' where id=?", {}, $id);
# return $q->p('Sorry, there has been an error confirming your update.');
#} else {
- dbh()->do("update comment set state='confirmed' where id=? and state='unconfirmed'", {}, $id);
+ dbh()->do("update comment set state='confirmed' where id=? and state='unconfirmed'", {}, $id);
#}
+
my ($problem_id, $fixed, $email, $name) = dbh()->selectrow_array(
"select problem_id, mark_fixed, email, name from comment where id=?", {}, $id);
my $creator_fixed = 0;
@@ -70,16 +76,23 @@ sub confirm_update {
dbh()->do("update problem set lastupdate = ms_current_timestamp()
where id=? and state='confirmed'", {}, $problem_id);
}
+
my $out = '';
if ($creator_fixed > 0 && $q->{site} ne 'emptyhomes') {
$out = ask_questionnaire($q->param('token'));
} else {
$out = $q->p(sprintf(_('You have successfully confirmed your update and you can now <a href="%s">view it on the site</a>.'), "/?id=$problem_id#update_$id"));
- if ($fixed) {
- $out .= CrossSell::display_advert($q, $email, $name);
- } else {
- $out .= advertise_updates($q, $problem_id, $email);
- }
+ #if ($fixed) {
+ $out .= CrossSell::display_advert($q, $email, $name);
+ #} else {
+ # $out .= advertise_updates($q, $problem_id, $email);
+ #}
+ }
+
+ # Subscribe updater to email updates if requested
+ if ($add_alert) {
+ my $alert_id = mySociety::Alert::create($email, 'new_updates', $problem_id);
+ mySociety::Alert::confirm($alert_id);
}
return $out;
@@ -111,7 +124,12 @@ sub confirm_problem {
. sprintf(_('. You can <a href="%s">view the problem on this site</a>.'), "/?id=$id")
);
}
- $out .= advertise_updates($q, $id, $email);
+
+ # Subscribe problem reporter to email updates
+ my $alert_id = mySociety::Alert::create($email, 'new_updates', $id);
+ mySociety::Alert::confirm($alert_id);
+
+ $out .= CrossSell::display_advert($q, $email);
return $out;
}
diff --git a/web/faq.cgi b/web/faq.cgi
index 4e3ce614e..cbb7d0039 100755
--- a/web/faq.cgi
+++ b/web/faq.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: faq.cgi,v 1.31 2008-05-15 16:09:52 matthew Exp $
+# $Id: faq.cgi,v 1.32 2008-09-17 16:55:58 matthew Exp $
use strict;
use Standard -db;
@@ -80,10 +80,10 @@ site if you let us, but not your email address; similarly with updates. We will
never give or sell your email address to anyone else, unless we are
obliged to by law.')),
$q->dt(_('Will you send nasty, brutish spam to my email address?')),
- $q->dd(_('Never. We will email you four weeks after you submit a
-problem, asking for a status update, and we\'ll only ever send you emails
-in relation to your problem. You can opt in to receive emails
-about updates to a particular problem.'))
+ $q->dd(_('Never. We will email you if someone leaves an update on a
+problem you&rsquo;ve reported, and send you a questionnaire email four weeks
+after you submit a problem, asking for a status update; we&rsquo;ll only ever
+send you emails in relation to your problem.'))
);
$out .= $q->h2(_('Organisation Questions'));
$out .= $q->dl(
diff --git a/web/index.cgi b/web/index.cgi
index d0471b81a..757ddfa8d 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.207 2008-09-16 15:48:16 matthew Exp $
+# $Id: index.cgi,v 1.208 2008-09-17 16:55:58 matthew Exp $
use strict;
use Standard;
@@ -157,7 +157,7 @@ EOF
sub submit_update {
my $q = shift;
- my @vars = qw(id name email update fixed upload_fileid);
+ my @vars = qw(id name email update fixed upload_fileid add_alert);
my %input = map { $_ => $q->param($_) || '' } @vars;
my @errors;
@@ -206,7 +206,7 @@ sub submit_update {
my $base = mySociety::Config::get('BASE_URL');
$base =~ s/matthew/emptyhomes.matthew/ if $q->{site} eq 'emptyhomes'; # XXX Temp
$base =~ s/matthew/scambs.matthew/ if $q->{site} eq 'scambs'; # XXX Temp
- $h{url} = $base . '/C/' . mySociety::AuthToken::store('update', $id);
+ $h{url} = $base . '/C/' . mySociety::AuthToken::store('update', { id => $id, add_alert => $input{add_alert} } );
dbh()->commit();
my $out = Page::send_email($q, $input{email}, $input{name}, 'update', %h);
@@ -846,6 +846,8 @@ $fixedline
<label for="form_photo">Photo:</label>
<input type="file" name="photo" id="form_photo">
</div>
+<div class="checkbox"><input type="checkbox" name="add_alert" id="form_add_alert" value="1">
+<label for="form_add_alert">Alert me to future updates</label></div>
<div class="checkbox"><input type="submit" id="update_post" value="Post"></div>
</form>
</div>