Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gitrows/lambda-mailchimp
Create or update a Mailchimp subscriber with a lambda function
https://github.com/gitrows/lambda-mailchimp
api-gateway aws lambda mailchimp
Last synced: 24 days ago
JSON representation
Create or update a Mailchimp subscriber with a lambda function
- Host: GitHub
- URL: https://github.com/gitrows/lambda-mailchimp
- Owner: gitrows
- Created: 2020-05-23T16:33:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-25T13:00:38.000Z (over 2 years ago)
- Last Synced: 2024-12-06T18:50:53.978Z (about 1 month ago)
- Topics: api-gateway, aws, lambda, mailchimp
- Language: JavaScript
- Size: 61.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lambda-mailchimp
Create or update a Mailchimp subscription with this simple lambda function. Use it as a proxy for the Mailchimp API from your website/app without exposing your API key or running into CORS problems.
## Usage
### Setup
Get your username, API key, data center and list or audience id from your Mailchimp account.
* Create an API key here: `https://admin.mailchimp.com/account/api/`
* Your datacenter is the the first subdomain part, e.g. `us18` when viewing your admin pages
* Find your unique list or audience id in your list or audience settingsMake a copy of the .env.sample
```shell
$ cp .env.sample .env
```and fill in your details.
### Upload
You can create a .zip file for uploading your lambda function to AWS with
```
$ npm run zip
```### API Gateway
After creating your new lambda function, uploading the zip file and saving your changes you add a new API Gateway trigger, leave all defaults as suggested by AWS and you're good to go.
You can send all parameters that should be proxied with a POST request to your new API endpoint, at least email_address is required. Read more about the optional parameters:
```shell
https://mailchimp.com/developer/reference/lists/list-members/
```### Return values
The lambda function transparently returns all reponse values from the Mailchimp API
### License
MIT