mailchimp@1.0.8
- addMember(params, [callback])
- archiveMember(params, [callback])
- deleteMember(params, [callback])
- get(path, query, [callback])
- listAudienceInfo(query, [callback])
- listAudiences(query, [callback])
- listBatches(params, [callback])
- listMembers(params, [callback])
- post(path, body, query, [callback])
- request(method, path, options, [callback])
- startBatch(params, [callback])
- tagMembers(params, [callback])
- updateMember(params, [callback])
- updateMemberTags(params, [callback])
- upsertMembers(params, [callback])
This adaptor exports the following from common:
- alterState()
- chunk()
- dataPath()
- dataValue()
- each()
- field()
- fields()
- fn()
- fnIf()
- lastReferenceValue()
- merge()
- sourceValue()
Functions
addMember
addMember(params, [callback]) ⇒ Operation
addMember to a list
Param | Type | Description |
---|---|---|
params | object | a listId, and options |
[callback] | function | Optional callback to handle the response |
archiveMember
archiveMember(params, [callback]) ⇒ Operation
archiveMember in a list
Param | Type | Description |
---|---|---|
params | object | a listId, and options |
[callback] | function | Optional callback to handle the response |
deleteMember
deleteMember(params, [callback]) ⇒ Operation
Permanently delete a member from a list
Param | Type | Description |
---|---|---|
params | object | a listId, and options |
[callback] | function | Optional callback to handle the response |
get
get(path, query, [callback]) ⇒ Operation
The get function is used to make a GET request to the Mailchimp API.
Param | Type | Description |
---|---|---|
path | string | The endpoint of the api to which the request should be made |
query | object | An object containing query parameters to be included in the request |
[callback] | function | (Optional) callback to handle the response |
Example: Get a list of account exports for a given account
get('/account-exports');
listAudienceInfo
listAudienceInfo(query, [callback]) ⇒ Operation
Get information about a specific list in your Mailchimp account. Results include list members who have signed up but haven't confirmed their subscription yet and unsubscribed or cleaned.
Param | Type | Description |
---|---|---|
query | object | listId and query parameters |
[callback] | function | Optional callback to handle the response |
listAudiences
listAudiences(query, [callback]) ⇒ Operation
Get information about all lists in the account.
Param | Type | Description |
---|---|---|
query | object | Query parameters |
[callback] | function | Optional callback to handle the response |
listBatches
listBatches(params, [callback]) ⇒ Operation
listBatches
Param | Type | Description |
---|---|---|
params | object | a listId, and options |
[callback] | function | Optional callback to handle the response |
listMembers
listMembers(params, [callback]) ⇒ Operation
listMembers
Param | Type | Description |
---|---|---|
params | object | a listId, and options |
[callback] | function | Optional callback to handle the response |
post
post(path, body, query, [callback]) ⇒ Operation
The post function is used to make a POST request to the Mailchimp API.
Param | Type | Description |
---|---|---|
path | string | The endpoint of the api to which the request should be made. |
body | object | The data to be sent in the body of the request |
query | object | An object containing query parameters to be included in the request |
[callback] | function | (Optional) callback to handle the response |
Example: Create a new account export in your Mailchimp account
post('/accounts-export', {include_stages:[]});
request
request(method, path, options, [callback]) ⇒ Operation
Make an HTTP request to Mailchimp API
Param | Type | Description |
---|---|---|
method | string | The HTTP method for the request (e.g., 'GET', 'POST', 'PUT', 'DELETE'). |
path | string | The endpoint of the api to which the request should be made. |
options | Object | Additional options for the request (query, body only). |
[callback] | function | (Optional) callback function to handle the response. |
Example: Get list to all other resources available in the API
request('GET','/');
Example: Create a new account export in your Mailchimp account
request('POST','/accounts-export', {include_stages:[]});
startBatch
startBatch(params, [callback]) ⇒ Operation
Start a batch with a list of operations.
Param | Type | Description |
---|---|---|
params | object | operations batch job |
[callback] | function | Optional callback to handle the response |
Example
startBatch(params)
tagMembers
tagMembers(params, [callback]) ⇒ Operation
Tag members with a particular tag
Param | Type | Description |
---|---|---|
params | object | a tagId, members, and a list |
[callback] | function | Optional callback to handle the response |
Example
tagMembers((state) => ({
listId: "someId", // All Subscribers list
tagId: "someTag", // User tag
members: state.response.body.rows.map((u) => u.email),
}));
Example
tagMembers((state) => ({
listId: "someId",
tagId: "someTag",
members: state.response.body.rows
.filter((u) => u.allow_other_emails)
.map((u) => u.email),
}));
updateMember
updateMember(params, [callback]) ⇒ Operation
updateMember
Param | Type | Description |
---|---|---|
params | object | a listId,subscriberHash and member |
[callback] | function | Optional callback to handle the response |
updateMemberTags
updateMemberTags(params, [callback]) ⇒ Operation
updateMemberTags
Param | Type | Description |
---|---|---|
params | object | a listId, and options |
[callback] | function | Optional callback to handle the response |
upsertMembers
upsertMembers(params, [callback]) ⇒ Operation
Add or update a list members
Param | Type | Description |
---|---|---|
params | object | a listId, users, and options |
[callback] | function | Optional callback to handle the response |
Example
upsertMembers((state) => ({
listId: "someId",
users: state.response.body.rows.map((u) => ({
email: u.email,
status: u.allow_other_emails ? "subscribed" : "unsubscribed",
mergeFields: { FNAME: u.first_name, LNAME: u.last_name },
})),
}));