Skip to content

Commit

Permalink
Merge pull request #324 from OpenFn/323-update-mailchimp-adaptor
Browse files Browse the repository at this point in the history
`mailchimp` new functions
  • Loading branch information
mtuchi authored Aug 1, 2023
2 parents fa4feae + 0db1204 commit 83e4f65
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 95 deletions.
13 changes: 13 additions & 0 deletions .changeset/smooth-countries-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@openfn/language-mailchimp': minor
---

Add new functions

- addMember()
- listMembers()
- deleteMember()
- listAudiences()
- archiveMember()
- updateMemberTags()
- listAudienceInfo()
30 changes: 0 additions & 30 deletions packages/mailchimp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,6 @@ official
[configuration-schema](https://docs.openfn.org/adaptors/packages/mailchimp-configuration-schema/)
definition.

#### sample expression with multiple operations

```js
upsertMembers({
listId: 'someId',
users: state =>
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 },
})),
options: {},
});

tagMembers({
listId: 'someId', // All Subscribers
tagId: 'someTag', // User
members: state => state.response.body.rows.map(u => u.email),
});

tagMembers({
listId: 'someId', // All Subscribers
tagId: 'someTag', // Other Emails Allowed
members: state =>
state.response.body.rows
.filter(u => u.allow_other_emails)
.map(u => u.email),
});
```

## Development

Clone the [adaptors monorepo](https://github.com/OpenFn/adaptors). Follow the
Expand Down
Loading

0 comments on commit 83e4f65

Please sign in to comment.