diff options
author | matthew <matthew> | 2009-02-16 17:38:42 +0000 |
---|---|---|
committer | matthew <matthew> | 2009-02-16 17:38:42 +0000 |
commit | 35198d01d655d2ac4e22d2255c282075c3f923fd (patch) | |
tree | c6afaa30a10fdd753755cefe244ff4de802d2687 /perllib/CrossSell.pm | |
parent | 11948c7e20df85f465d1b5c3e7112ed917d26efd (diff) |
Ad newsletter.
Diffstat (limited to 'perllib/CrossSell.pm')
-rw-r--r-- | perllib/CrossSell.pm | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/perllib/CrossSell.pm b/perllib/CrossSell.pm index 2e0fefab2..18f45907f 100644 --- a/perllib/CrossSell.pm +++ b/perllib/CrossSell.pm @@ -9,7 +9,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: CrossSell.pm,v 1.14 2008-10-08 16:57:35 matthew Exp $ +# $Id: CrossSell.pm,v 1.15 2009-02-16 17:38:42 matthew Exp $ # Config parameters site needs set to call these functions: # OPTION_AUTH_SHARED_SECRET @@ -110,6 +110,25 @@ EOF return ($out, "cheltenhamhfyc$rand"); } +sub display_news_form { + my (%input) = @_; + my %input_h = map { $_ => $input{$_} ? ent($input{$_}) : '' } qw(name email signed_email); + my $auth_signature = $input_h{signed_email}; + return <<EOF; +<h1 style="padding-top:0.5em">mySociety newsletter</h1> + +<p>Enter your email address below and we’ll send you occasional emails about what we’ve been up to.</p> + +<form method="post" action="https://secure.mysociety.org/admin/lists/mailman/subscribe/news"> +<label for="name">Name:</label> +<input type="text" name="fullname" id="name" value="$input_h{name}" size="30"> +<br><label for="email">Email:</label> +<input type="text" name="email" id="email" value="$input_h{email}" size="30"> + <input type="submit" value="Add me to the list"> +</form> +EOF +} + sub display_tms_form { my (%input) = @_; my %input_h = map { $_ => $input{$_} ? ent($input{$_}) : '' } qw(name email postcode mobile signed_email); @@ -157,16 +176,16 @@ sub display_advert ($$;$%) { } } - unless (defined $data{done_tms} && $data{done_tms}==1) { - $q->{scratch} = 'advert=tms'; + #unless (defined $data{done_tms} && $data{done_tms}==1) { + $q->{scratch} = 'advert=news'; my $auth_signature = ''; unless (defined $data{emailunvalidated} && $data{emailunvalidated}==1) { $auth_signature = mySociety::AuthToken::sign_with_shared_secret($email, mySociety::Config::get('AUTH_SHARED_SECRET')); } return '<div style="margin: 0 5em; border-top: dotted 1px #666666;">' - . display_tms_form(email => $email, name => $name, signed_email => $auth_signature) + . display_news_form(email => $email, name => $name, signed_email => $auth_signature) . '</div>'; - } + #} my @adverts = ( [ 'gny0', '<h2>Are you a member of a local group…</h2> …which uses the internet to coordinate itself, such as a neighbourhood watch? If so, please help the charity that runs FixMyStreet by <a href="http://www.groupsnearyou.com/add/about/">adding some information about it</a> to our new site, GroupsNearYou.' ], |