-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
969 additions
and
618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
SECRET_KEY="secr3t-k3y" | ||
GOOGLE_ANALYTICS="" | ||
GOOGLE_SITE_VERIFICATION="" | ||
MAILCHIMP_MYSOC_KEY="" | ||
MAILCHIMP_MYSOC_SERVER_PREFIX="" | ||
MAILCHIMP_MYSOC_LIST_ID="" | ||
MAILCHIMP_TCC_KEY="" | ||
MAILCHIMP_TCC_SERVER_PREFIX="" | ||
MAILCHIMP_TCC_LIST_ID="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
|
||
import mailchimp_marketing as MailchimpMarketing | ||
from mailchimp_marketing.api_client import ApiClientError | ||
|
||
|
||
class Command(BaseCommand): | ||
def handle(self, *args, **kwargs): | ||
try: | ||
client = MailchimpMarketing.Client() | ||
client.set_config( | ||
{ | ||
"api_key": settings.MAILCHIMP_MYSOC_KEY, | ||
"server": settings.MAILCHIMP_MYSOC_SERVER_PREFIX, | ||
} | ||
) | ||
response = client.ping.get() | ||
print(response) | ||
except ApiClientError as error: | ||
print(error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,42 @@ <h1 class="mb-4">Contact us</h1> | |
<p>Whether you’ve spotted an error on the site, or you have new data to contribute, or you need help managing your account, or anything else – send an email to <a href="mailto:[email protected]">[email protected]</a>, and we’ll direct your message to the right place.</p> | ||
|
||
</div> | ||
|
||
<div class="readable"> | ||
<form id="mailing_list_signup" method="POST" action="{% url 'mailing_list_signup' %}"> | ||
{% csrf_token %} | ||
<h2 class="h4">Want notifications when we add new data?</h2> | ||
<fieldset> | ||
<legend>Let us know your email address and we’ll notify you about new data:</legend> | ||
<div class="mb-3"> | ||
<label class="form-label" for="full_name">Name</label> | ||
<input type="text" name="full_name" id="full_name" class="form-control"> | ||
</div> | ||
<div class="mb-3"> | ||
<label class="form-label" for="email">Email address</label> | ||
<input type="email" name="email" id="email" class="form-control"> | ||
</div> | ||
</fieldset> | ||
<fieldset> | ||
<legend>You can also, optionally, join our newsletters for more inspiration on data, democracy, and climate action:</legend> | ||
<div class="form-check"> | ||
<input class="form-check-input" type="checkbox" value="yes" name="mysoc_signup" id="mysoc_signup"> | ||
<label class="form-check-label" for="mysoc_signup"> | ||
mySociety | ||
<a href="https://www.mysociety.org/privacy/">(privacy policy)</a> | ||
</label> | ||
</div> | ||
<div class="form-check"> | ||
<input class="form-check-input" type="checkbox" value="yes" name="tcc_signup" id="tcc_signup"> | ||
<label class="form-check-label" for="tcc_signup"> | ||
The Climate Coalition | ||
<a href="https://www.theclimatecoalition.org/privacy-policy">(privacy policy)</a> | ||
</label> | ||
</div> | ||
</fieldset> | ||
<button type="submit" class="btn btn-primary mt-4">Subscribe</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{% extends "hub/base.html" %} | ||
|
||
{% block content %} | ||
|
||
<div class="py-4 py-lg-5"> | ||
<div class="container"> | ||
<div class="readable"> | ||
<h1 class="mb-4">Signed up</h1> | ||
|
||
<p>Thanks for signing up!</p> | ||
|
||
</div> | ||
|
||
<!-- | ||
<div class="readable"> | ||
<form method="POST" action="{% url 'mailing_list_signup' %}"> | ||
<h2 class="h4">Want notifications when we add new data?</h2> | ||
<fieldset> | ||
<legend>Let us know your email address and we’ll notify you about new data:</legend> | ||
<div class="mb-3"> | ||
<label class="form-label" for="name">Name</label> | ||
<input type="text" id="name" class="form-control"> | ||
</div> | ||
<div class="mb-3"> | ||
<label class="form-label" for="email">Email address</label> | ||
<input type="email" id="email" class="form-control"> | ||
</div> | ||
</fieldset> | ||
<fieldset> | ||
<legend>You can also, optionally, join our newsletters for more inspiration on data, democracy, and climate action:</legend> | ||
<div class="form-check"> | ||
<input class="form-check-input" type="checkbox" value="" id="check1"> | ||
<label class="form-check-label" for="check1"> | ||
mySociety | ||
<a href="https://www.mysociety.org/privacy/">(privacy policy)</a> | ||
</label> | ||
</div> | ||
<div class="form-check"> | ||
<input class="form-check-input" type="checkbox" value="" id="check2"> | ||
<label class="form-check-label" for="check2"> | ||
The Climate Coalition | ||
<a href="https://www.theclimatecoalition.org/privacy-policy">(privacy policy)</a> | ||
</label> | ||
</div> | ||
</fieldset> | ||
<button type="submit" class="btn btn-primary mt-4">Subscribe</button> | ||
</form> | ||
</div> | ||
--> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.