
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
loopback-component-mailchimp
Advanced tools
Loopback connector module which allow to send emails via Mailchimp.
npm install loopback-component-mailchimp --save
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
}
}
}
| Property | Description |
|---|---|
| apiKey | MailChimp API key (required) |
| defaultListId | The ID of the destination list to subscribe/unsubscribes users to/from, if unspecified in calls to subscribe/unsubscribe (optional) |
| updateIfExists | Whether to update users if they already exist in the list (optional, defaults to false) |
| defaults | Optional parameters to pass with subscribe; supported properties are double_optin (boolean, defaults to false) and tags (array, defaults to null) |
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);
});
FAQs
Loopback component for Mailchimp
We found that loopback-component-mailchimp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.