Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailchimp new functions #324

Merged
merged 9 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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