aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Page.pm12
-rwxr-xr-xweb/alert.cgi4
-rwxr-xr-xweb/index.cgi6
3 files changed, 12 insertions, 10 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 36695cee8..162e01acd 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.35 2007-02-02 16:17:18 matthew Exp $
+# $Id: Page.pm,v 1.36 2007-02-02 23:24:01 matthew Exp $
#
package Page;
@@ -161,7 +161,8 @@ EOF
# send_email TO (NAME) TEMPLATE-NAME PARAMETERS
sub send_email {
- my ($email, $name, $template, %h) = @_;
+ my ($email, $name, $thing, %h) = @_;
+ my $template = "$thing-confirm";
$template = File::Slurp::read_file("$FindBin::Bin/../templates/emails/$template");
my $to = $name ? [[$email, $name]] : $email;
my $message = mySociety::Email::construct_email({
@@ -172,14 +173,15 @@ sub send_email {
});
my $result = mySociety::Util::send_email($message, mySociety::Config::get('CONTACT_EMAIL'), $email);
my $out;
+ my $action = ($thing eq 'alert') ? 'confirmed' : 'posted';
if ($result == mySociety::Util::EMAIL_SUCCESS) {
$out = <<EOF;
<h1>Nearly Done! Now check your email...</h1>
<p>The confirmation email <strong>may</strong> take a few minutes to arrive &mdash; <em>please</em> be patient.</p>
<p>If you use web-based email or have 'junk mail' filters, you may wish to check your bulk/spam mail folders: sometimes, our messages are marked that way.</p>
-<p>You must now click on the link within the email we've just sent you -
-<br>if you do not, your update will not be posted.</p>
-<p>(Don't worry - we'll hang on to your update while you're checking your email.)</p>
+<p>You must now click on the link within the email we've just sent you &mdash;
+if you do not, your $thing will not be $action.</p>
+<p>(Don't worry &mdash; we'll hang on to your $thing while you're checking your email.)</p>
EOF
} else {
$out = <<EOF;
diff --git a/web/alert.cgi b/web/alert.cgi
index 724e1731f..f706eb065 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: alert.cgi,v 1.2 2007-01-26 22:48:31 matthew Exp $
+# $Id: alert.cgi,v 1.3 2007-02-02 23:24:01 matthew Exp $
use strict;
require 5.8.0;
@@ -89,7 +89,7 @@ EOF
$h{url} = mySociety::Config::get('BASE_URL') . '/A/'
. mySociety::AuthToken::store('alert', { id => $alert_id, type => 'subscribe' } );
dbh()->commit();
- $out = Page::send_email($email, undef, 'alert-confirm', %h);
+ $out = Page::send_email($email, undef, 'alert', %h);
}
} elsif ($q->param('id')) {
$out = display_form($q);
diff --git a/web/index.cgi b/web/index.cgi
index 4cc801cb1..c0eeacd80 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.66 2007-02-02 22:01:45 matthew Exp $
+# $Id: index.cgi,v 1.67 2007-02-02 23:24:01 matthew Exp $
# TODO
# Nothing is done about the update checkboxes - not stored anywhere on anything!
@@ -142,7 +142,7 @@ sub submit_update {
$h{url} = mySociety::Config::get('BASE_URL') . '/C/' . mySociety::AuthToken::store('update', $id);
dbh()->commit();
- my $out = Page::send_email($input{email}, $input{name}, 'update-confirm', %h);
+ my $out = Page::send_email($input{email}, $input{name}, 'update', %h);
return $out;
}
@@ -236,7 +236,7 @@ sub submit_problem {
$h{url} = mySociety::Config::get('BASE_URL') . '/P/' . mySociety::AuthToken::store('problem', $id);
dbh()->commit();
- my $out = Page::send_email($input{email}, $input{name}, 'problem-confirm', %h);
+ my $out = Page::send_email($input{email}, $input{name}, 'problem', %h);
return $out;
}