Giter VIP home page Giter VIP logo

chimplist's Introduction

chimplist

npm Travis (.org) npm GitHub stars

Chimplist makes it very easy and simple to work with Mailchimp's API v3 to manage your Lists(also called Audiences) and their Members.

How to install?

npm install chimplist

How to use Chimplist?

*ES6 Syntax

const Chimplist = require("chimplist");

const API_KEY = "your Mailchimp API KEY";

const Chimp = new Chimplist(API_KEY);

/* Using `getAllLists()` function to get information about all lists
 * All the available functions with Chimplist are mentioned down below.
 * This is how you would work with the new ES6 promise syntax with .then .catch */
Chimp.getAllLists()
  .then((response) => {
    // Work with the `response` from Mailchimp API
    // `response` is a standard HTTP response(Headers, Body, etc).
  })
  .catch((error) => {
    // Handle any errors while running `getAllLists()`
  });

// You can use async/await inside try/catch block as well
const functionName = async () => {
  try {
    const response = await Chimp.getAllLists();
    // Work with the `response` from Mailchimp API
  } catch (error) {
    // Handle any errors while running `getAllLists()`
  }
};

// Call the function to execute the try/catch block code
functionName();

Why Chimplist?

A lot of people use Mailchimp for their list feature. Chimplist aims at the people who quickly just want to add a sign up to newsletter type of form to their website. This library aims to help them get started working with Mailchimp lists with ease and simplicity by making sure:

  • You don't have to worry about the Mailchimp's API end points.
  • You don't have to worry about handling authorizations.
  • You don't have to worry about knowing how to make HTTP requests.
  • You can use it on your back-end with just few lines of code.

Note: At the moment, Chimplist do not support the capability to apply request query parameters to your API requests for keeping things simple. Maybe in the future that feature might be added, untill then you might like using something like node-mailchimp.

Chimplist's Functions Guide

list_id - The list id(also known as Audience ID) of the specific list you are targeting. Can be found in Audience -> Settings -> Audience name and campaign defaults. Data type is string.

options - The data object which contains at least the required request body parameters. Reference links are provided down below along with those specific functions. Data type is object.

subscriber_hash - According to Mailchimp API documentation: "it is The MD5 hash of the lowercase version of the list member's email address". But it's basically the id of the member. It looks like 5adgf4de580e68d565db69db203a5c88. Data type is string.

LIST Functions

  • createList(options) - Create a new list

    options -> to learn more about what options should contain, refer to mailchimp api documentaion here.

  • getAllLists() - Get information about all lists in the account.

  • getList(list_id) - Get information about a specific list.

  • updateList(list_id, options) - Update a specific list

    options -> To learn more about what options should contain, refer to Mailchimp API Documentaion here.

  • deleteList(list_id) - Delete a specific list

MEMBER Functions

  • addMember(list_id, options) - Add a new list member

    options -> to learn more about what options should contain, refer to mailchimp api documentaion here.

  • getAllMembers(list_id) - Get information about members in a list

  • getMember(list_id, subscriber_hash) - Get information about a specific list memeber.

  • updateMember(list_id, subscriber_hash, options) - Update a specific list memeber.

    options -> to learn more about what options should contain, refer to mailchimp api documentaion here.

  • archiveMember(list_id, subscriber_hash) - Archive a list memeber.

  • deleteMember(list_id, subscriber_hash) - Permanently delete a list member.

chimplist's People

Contributors

ceoshikhar avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.