Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 819 Bytes

File metadata and controls

33 lines (22 loc) · 819 Bytes

Mailchimp Subscribe

Use the Mailchimp v3 API to perform a determined subscribe request

Example request

POST a JSON body with the following structure:

  • email:string — required
  • list_id:string — required
  • interests:string[] — optional
{
  "email": "ay@email.com",
  "list_id": "2450jasf28",
  "interests": ["3242ada24"]
}

API Key & Env Config

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.

Requests

  1. 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
  2. Add subscriber to list, with optional interests