Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mailchimp-lite

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mailchimp-lite

A lightweight wrapper for Mailchimp's v2 and v3 apis

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
64
decreased by-32.63%
Maintainers
1
Weekly downloads
 
Created
Source

mailchimp-lite Build Status NPM package Join the chat at https://gitter.im/NickTomlin/mailchimp-lite

A lightweight wrapper for Mailchimp's v2 and v3 apis.

npm i mailchimp-lite --save

Usage

let Mailchimp = require('mailchimp-lite');

let mailchimp = new Mailchimp({
  key: process.env.MAILCHIMP_API_KEY,
  datacenter: MAILCHIMP_DATACENTER
});

// get details on a list
mailchimp
  .get('/list/my-list-id')
  .then((listInstance) => {
    console.log(listInstance);
  });

// delete a list
mailchimp
  .delete('/lists/my-list-id');

// use the v2 api to batch-subscribe (currently not available in V3 api)
return mailchimp.v2.post('/lists/batch-subscribe', {
  id: 'my-list-id'
  update_existing: true,
  double_optin: false,
  replace_interests: false,
  batch: [
    {email: {email: 'freddy@mailchimp.com'}}
  ]
})
.then((response) => { console.log(response); })

Error Handling

Responses with a non 200-300 status will reject with an Error object. The error has a response which is the response object from request.

mailchimp
  .get('/list/my-list-id')
  .catch((error) => {
    console.log(error); // Mailchimp Error: 401
    console.log(error.response);
  });

Contributing

After cloning this repository:

npm i

# run the tests
npm t

Keywords

FAQs

Package last updated on 27 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc