Skip to content

Commit 2e1da6f

Browse files
committed
Add READMEs
1 parent a71c7e4 commit 2e1da6f

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Netlify Functions
2+
3+
A collection of example Netlify functions ready to drop into JAMstack projects
4+
5+
1. [Mailchimp Subscribe](./functions/mailchimp-subscribe/README.md)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Mailchimp Subscribe
2+
3+
Use the Mailchimp v3 API to perform a determined subscribe request
4+
5+
## Example request
6+
7+
POST a JSON body with the following structure:
8+
9+
- `email:string` — required
10+
- `list_id:string` — required
11+
- `interests:string[]` — optional
12+
13+
```json
14+
{
15+
"email": "ay@email.com",
16+
"list_id": "2450jasf28",
17+
"interests": ["3242ada24"]
18+
}
19+
```
20+
21+
## API Key & Env Config
22+
23+
A `MAILCHIMP_API_KEY` is required and should have rights to modify the desired list id. See Netlify docs for adding env vars and Mailchimp for API key creation.
24+
25+
## Requests
26+
27+
1. Check if existing audience member
28+
29+
- If existing and subscribed: done
30+
- If existing but unsubscribed, resubscribe: done
31+
- `TODO`: also diff interests and update if necessary
32+
33+
1. Add subscriber to list, with optional interests

0 commit comments

Comments
 (0)