Skip to content

arrayofone/loopback-component-mailchimp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loopback-connector-mailchimp

Loopback connector module which allow to send emails via Mailchimp.

1. Installation

npm install loopback-component-mailchimp --save

2. Configuration

component-config.json

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

3. Use

Simple subscribe member. Returns a Promise

  app.MailChimp.subscribe({
    email : '[email protected]',
    id : defaultListId,
    firstName : 'A name',
    lastName : 'A surname',
    merge_vars : {
      optin_ip : '192.168.0.1'
    }
  })
    .then(function (res) {
      console.log('Result :',res);
    })
    .catch(function (err) {
    console.log('Error : ',err);
  });

Simple unsubscribe member. Returns a Promise

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

About

Loopback connector for Mailchimp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%