Use the Mailchimp v3 API to perform a determined subscribe request
POST a JSON body with the following structure:
email:string
— requiredlist_id:string
— requiredinterests:string[]
— optional
{
"email": "ay@email.com",
"list_id": "2450jasf28",
"interests": ["3242ada24"]
}
A MAILCHIMP_API_KEY
is required and should have permissions to modify the desired list id. See Netlify docs for adding env vars and Mailchimp for API key creation.
-
Check if existing audience member
- If existing and subscribed and done
- If existing but unsubscribed, resubscribe and done
- If existing but missing interests, update preferences and done
-
Add subscriber to list, with optional interests