Skip to content

Commit

Permalink
Adds mailing list signup via MailChimp integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tantalic committed Feb 27, 2016
1 parent f4a5515 commit baf8b42
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 69 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ make osx
## Running (in Production)
Running the site will require the setting of a number of options. These options can be set via command line flags or environment variables.

| Environment Variable | Flag | Description | Default Value |
|--------------------------------|-----------------|------------------------------------------------------------------------------------------|---------------|
| `$HACK_BELLINGHAM_PORT` | `--port` | The TCP port to listen on. | `3000` |
| `$HACK_BELLINGHAM_HOST` | `--host` | The IP address/hostname to listen on. | All hosts |
| `$HACK_BELLINGHAM_SLACK_TEAM` | `--slack-team` | Slack team name, as found in the slack URL. | `""` |
| `$HACK_BELLINGHAM_SLACK_TOKEN` | `--slack-token` | Access token for your slack team. It can be generated at https://api.slack.com/web#auth. | `""` |
| Environment Variable | Flag | Description | Default Value |
|------------------------------------|---------------------|------------------------------------------------------------------------------------------|---------------|
| `$HACK_BELLINGHAM_PORT` | `--port` | The TCP port to listen on. | `3000` |
| `$HACK_BELLINGHAM_HOST` | `--host` | The IP address/hostname to listen on. | All hosts |
| `$HACK_BELLINGHAM_SLACK_TEAM` | `--slack-team` | Slack team name, as found in the slack URL. | `""` |
| `$HACK_BELLINGHAM_SLACK_TOKEN` | `--slack-token` | Access token for your slack team. It can be generated at https://api.slack.com/web#auth. | `""` |
| `$HACK_BELLINGHAM_MAILCHIMP_TOKEN` | `--mailchimp-token` | The API token for your MailChimp account. | `""` |
| `$HACK_BELLINGHAM_MAILCHIMP_LIST` | `--mailchimp-list` | The ID of the MailChimp list. | |

### systemd Configuration
The canonical way to run the site is through the [`systemd`][systemd] service manager to setup the environment, manage when the application is started, and monitor the process to keep it running. This can be done with a system file like the one below:
Expand Down
26 changes: 24 additions & 2 deletions assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,23 @@
font-family: 'Roboto Slab', Arial, serif;
}
input {
width: 93.25%;
width: 97.75%;
padding: 2.25% 1.125%;
}
input[type=checkbox] {
width: auto;
position: absolute;
top: .25em;
left: 0;
margin: 0 0 0 0;
}
label {
font-size: .5em;
display: block;
margin: 1em 0;
padding: 0 0 0 25px;
position: relative;
}
button {
border-radius: 1.5em;
border-style: none;
Expand Down Expand Up @@ -98,6 +112,12 @@ <h1>Hack Bellingham is a social group dedicated to growing the local developer c
<div id="slack-form">
<h2>Join us on Slack:</h2>
<input type="text" placeholder="email address" id="email-address" autofocus>

<label for="mailing-list-opt-in">
<input type="checkbox" id="mailing-list-opt-in" name="mailing-list-opt-in" checked>
Also add me to the Hack Bellingham mailing list. (Email volume will be low. We hate superfluous email just as much then you do.)
</label>

<button onclick="requestInvite();" id="invite-button">Send me an invite</button>
</div>

Expand All @@ -115,7 +135,9 @@ <h2>Join us on Slack:</h2>
xhr.open('POST', encodeURI('request-invite'));
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({
email: document.getElementById("email-address").value
email: document.getElementById("email-address").value,
requestSlack: true,
requestMailingList: document.getElementById("mailing-list-opt-in").checked
}));


Expand Down
4 changes: 2 additions & 2 deletions bindata_assetfs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit baf8b42

Please sign in to comment.