New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

loopback-component-mailchimp

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-component-mailchimp

Loopback component for Mailchimp

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

loopback-connector-mailchimp

Loopback connector module which allow to send emails via Mailchimp.

1. Installation

npm install loopback-component-mailchimp --save

2. Configuration

Add the following to component-config.json:

{
    "loopback-component-mailchimp": {
        "apiKey": "[your api key here]",
        "defaultListId": "[a default listId]",
        "updateIfExists": true,
        "defaults": {
          "double_optin" : true
        }
    }
}

Config Properties

PropertyDescription
apiKeyMailChimp API key (required)
defaultListIdThe ID of the destination list to subscribe/unsubscribes users to/from, if unspecified in calls to subscribe/unsubscribe (optional)
updateIfExistsWhether to update users if they already exist in the list (optional, defaults to false)
defaultsOptional parameters to pass with subscribe; supported properties are double_optin (boolean, defaults to false) and tags (array, defaults to null)

3. Use

Subscribe a member. Required properties are email, firstName and lastName. Optional properties are tags and merge_fields. Returns a Promise:

var user = {
    email: 'user@email.com',
    firstName: 'A name',
    lastName: 'A surname',
    tags: ['[a tag]'],
    merge_fields: {
        optin_ip: '192.168.0.1'
    }
}

app.MailChimp.subscribe(user, listId)
    .then(function (res) {
        console.log('Result :', res);
    })
    .catch(function (err) {
        console.log('Error : ', err);
    });

Simple unsubscribe member. Returns a Promise:

var user = {
    email: 'user@email.com'
}

app.MailChimp.unsubscribe(user, listId)
    .then(function (res) {
        console.log('Result :', res);
    })
    .catch(function (err) {
        console.log('Error : ', err);
    });

Add tags for a subscribed member. Returns a Promise:

var user = {
    email: 'user@email.com'
}

var tags = {
    'user'
}

app.MailChimp.addTags(user, tags, listId)
    .then(function (res) {
        console.log('Result :', res);
    })
    .catch(function (err) {
        console.log('Error : ', err);
    });

Keywords

FAQs

Package last updated on 15 Aug 2019

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