Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsthatguy/mailchimp-subscription-middleware
Middleware to enable server-side mailchimp subscription requests
https://github.com/itsthatguy/mailchimp-subscription-middleware
Last synced: about 6 hours ago
JSON representation
Middleware to enable server-side mailchimp subscription requests
- Host: GitHub
- URL: https://github.com/itsthatguy/mailchimp-subscription-middleware
- Owner: itsthatguy
- Created: 2016-09-22T17:37:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-22T17:46:10.000Z (about 8 years ago)
- Last Synced: 2024-10-23T03:34:20.986Z (24 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MailChimp Subscription Middleware
## Assumptions
* You have a mailchimp account
* You've created a list
* You have an API Key
* You know what a computer is## Use it
* API key
http://kb.mailchimp.com/integrations/api-integrations/about-api-keys
* List ID http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id
**Do not** remove the `-` at the end of your API token```javascript
// express.js example
var mcSubscriber = require('mailchimp-subscription-middleware');var options = {
apiKey: 'abcdefghijklmnopqrstuvwxyz123456-us12',
listId: '9e67587f52'
};app.use('/subscribe', mcSubscriber(options));
``````javascript
// browsersync example
// assumes that you have browsersync setup. This only shows how to use the
// middleware in your existing setup
// https://www.browsersync.io/docs/options/
var mcSubscriber = require('mailchimp-subscription-middleware');var options = {
apiKey: 'abcdefghijklmnopqrstuvwxyz123456-us12',
listId: '9e67587f52'
};
var browserSyncOptions = {
...
middleware: [{
route: '/subscribe',
handle: mcSubscriber(options)
}]
...
};
```## Response
```javascript
{
"data":
}
```