0.0.3 • Published 8 years ago

mailchimp-subscription-middleware v0.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

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

// express.js example
var mcSubscriber = require('mailchimp-subscription-middleware');

var options = {
  apiKey: 'abcdefghijklmnopqrstuvwxyz123456-us12',
  listId: '9e67587f52'
};

app.use('/subscribe', mcSubscriber(options));
// 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

{
  "data": <Mailchimp Server Response>
}