{
  "id": "IdsRFlOwww9fZQlo",
  "name": "Zoom contacts to Mailchimp double opt in integration",
  "tags": [],
  "nodes": [
    {
      "id": "d70c0a2d-5210-41d8-93b2-2e1d2a57d187",
      "name": "Update a member",
      "type": "n8n-nodes-base.mailchimp",
      "onError": "continueRegularOutput",
      "position": [
        976,
        416
      ],
      "parameters": {
        "list": "LIST_ID_HERE",
        "email": "={{ $json.email }}",
        "operation": "update",
        "updateFields": {},
        "authentication": "oAuth2"
      },
      "typeVersion": 1
    },
    {
      "id": "4a7b461a-cf25-4012-b117-7fd3428e6666",
      "name": "Get Webinar Attendees from Zoom",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        208,
        416
      ],
      "parameters": {
        "url": "=https://api.zoom.us/v2/webinars/{{ $json.webinar_id }}/registrants?occurrence_id={{ $json.occurence_id }}&page_size=300",
        "options": {},
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "zoomOAuth2Api"
      },
      "typeVersion": 4.2
    },
    {
      "id": "35555aa1-6696-4aa3-ad81-74a69087bfb9",
      "name": "Extract Registrant Emails",
      "type": "n8n-nodes-base.code",
      "position": [
        448,
        416
      ],
      "parameters": {
        "jsCode": "// Get all input items\nconst items = $input.all();\n\n// Extract emails from all registrants\nconst emails = [];\n\nfor (const item of items) {\n  const registrants = item.json.registrants || [];\n  \n  for (const registrant of registrants) {\n    if (registrant.email) {\n      emails.push(registrant.email);\n    }\n  }\n}\n\n// Return as n8n format - one item per email\nreturn emails.map(email => ({\n  json: {\n    email: email\n  }\n}));"
      },
      "typeVersion": 2
    },
    {
      "id": "62579a13-9f79-4718-873f-f270bfa9edb4",
      "name": "Filter Out Internal Emails",
      "type": "n8n-nodes-base.filter",
      "position": [
        720,
        416
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "97cf11bb-f8ca-4d30-b9b9-db92fe3fa42e",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.email }}",
              "rightValue": "@yourcompanydomain.com"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "468039a4-b1f9-41df-b8cb-f19e62bfdb8a",
      "name": "MD5 Hash Email",
      "type": "n8n-nodes-base.code",
      "position": [
        1488,
        400
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "const crypto = require('crypto');\nconst email = $('Filter Out Internal Emails').item.json.email.toLowerCase();\nconst hash = \n  crypto.createHash('md5').update(email).digest('hex');\n\nreturn { hash: hash };"
      },
      "typeVersion": 2
    },
    {
      "id": "3d2142e4-f2bb-44f0-92fe-103f3e4accad",
      "name": "If ID doesn't exist",
      "type": "n8n-nodes-base.if",
      "position": [
        1216,
        416
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "cb0a2019-f3a1-498f-bc57-b324d6bd9123",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $json.id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "c1d7c737-41fb-4ba6-9d08-d55cc37b7081",
      "name": "Mailchimp - Send Double Opt in Email",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1744,
        400
      ],
      "parameters": {
        "url": "=https://us4.api.mailchimp.com/3.0/lists/LIST_ID_HERE/members/{{$json.hash}}",
        "method": "PUT",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 10
            }
          }
        },
        "jsonBody": "={\n  \"email_address\": \"{{ $('Filter Out Internal Emails').item.json.email }}\",\n  \"status_if_new\": \"pending\",\n  \"status\": \"pending\"\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9f967d14-ac27-4334-ac34-df5fd9059054",
      "name": "Mailchimp - Add Leads Tag",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1952,
        400
      ],
      "parameters": {
        "url": "=https://us4.api.mailchimp.com/3.0/lists/LIST_ID_HERE/members/{{ $('MD5 Hash Email').item.json.hash }}/tags",
        "method": "POST",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 10
            }
          }
        },
        "jsonBody": "={\n  \"tags\": [\n    {\n      \"name\": \"Leads\",\n      \"status\": \"active\"\n    }\n  ]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBasicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "6a2ff6d9-e05c-4b9b-a555-6ce661c8625f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        96
      ],
      "parameters": {
        "color": 7,
        "width": 2496,
        "height": 560,
        "content": "## Sync Zoom Webinar Attendees to Mailchimp  \n\n**1) Manual Trigger**   \n**2) Type in IDs** \u2014 sets `webinar_id` and `occurrence_id` inputs for Zoom API call  \n**3) Get Webinar Attendees from Zoom** \u2014 Fetches registrants using Zoom's API  \n**4) Extract Registrant Emails** \u2014 Parses and extracts email addresses via JavaScript  \n**5) Filter Out Internal Emails** \u2014 Removes internal company email addresses  \n**6) Update a member \u2014 update: member** \u2014 Attempts to update the attendee in Mailchimp  \n**7) If ID doesn\u2019t exist** \u2014 Checks if the attendee already exists in Mailchimp  \n**8) MD5 Hash Email** \u2014 Hashes email for Mailchimp double opt-in  \n**9) Mailchimp - Send Double Opt in Email** \u2014 Sends opt-in confirmation email\n**10) Mailchimp - Add Leads Tag** \u2014 Tags new contacts with \"Leads\" in Mailchimp"
      },
      "typeVersion": 1
    },
    {
      "id": "be709aa1-f005-4d7b-aec5-330c87280cc0",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1040,
        96
      ],
      "parameters": {
        "width": 656,
        "height": 944,
        "content": "## Sync Zoom Webinar Attendees to Mailchimp  \n**Try out using to sync Zoom webinar attendees into Mailchimp with email validation and tagging.**\n\n### About Workflow  \nThis workflow pulls attendee data from Zoom webinars, filters out internal contacts, and either updates or creates contacts in Mailchimp. It ensures that only valid leads are added by using a double opt-in process.\n\n### Use Case  \nIdeal for marketing teams running recurring webinars who need to manage leads and contact updates in Mailchimp. Helps automate lead tagging and follow-up communications.\n\n### How it works  \n- Query/filter logic  \n=> gets webinar attendees by webinar ID; filters out internal email addresses  \n- Transformations/splits/lookups  \n=> extract emails with JS, hash email for Mailchimp, conditional check if user exists   \n- Final output step  \n=> Sends double opt-in email and tags the lead in Mailchimp\n\n### How to use  \n- Enter the correct Zoom webinar ID manually\n- Set schedule according to your webinar frequency  \n- Customize the internal email filter and Mailchimp tag as needed\n\n### Requirements  \n- Mailchimp account  \n- Zoom account with API access\n\n### Need Help? \n- Reach out through n8n community => https://community.n8n.io/u/easy8.ai\n- Contant our team directly => Easy8.ai\n- Visit our youtube channel => https://www.youtube.com/@easy8ai "
      },
      "typeVersion": 1
    },
    {
      "id": "a88ae5b9-95a7-4f2a-86d9-97994d3c9661",
      "name": "Type in IDs",
      "type": "n8n-nodes-base.set",
      "position": [
        -32,
        416
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3d2b3f3d-c9fc-4d98-b8d6-8bd11b5a3266",
              "name": "webinar_id",
              "type": "string",
              "value": "add ID of webinar series"
            },
            {
              "id": "c37660b5-1518-4069-9f52-a529f55e939f",
              "name": "occurence_id",
              "type": "string",
              "value": "add Occurence ID"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c0c96ec9-ee24-4c4c-b31a-777720b185ac",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -304,
        416
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7d452bb4-013e-4569-9278-682065f68ebe",
  "connections": {
    "Type in IDs": {
      "main": [
        [
          {
            "node": "Get Webinar Attendees from Zoom",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "MD5 Hash Email": {
      "main": [
        [
          {
            "node": "Mailchimp - Send Double Opt in Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update a member": {
      "main": [
        [
          {
            "node": "If ID doesn't exist",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If ID doesn't exist": {
      "main": [
        [
          {
            "node": "MD5 Hash Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Registrant Emails": {
      "main": [
        [
          {
            "node": "Filter Out Internal Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Out Internal Emails": {
      "main": [
        [
          {
            "node": "Update a member",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Webinar Attendees from Zoom": {
      "main": [
        [
          {
            "node": "Extract Registrant Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Mailchimp - Send Double Opt in Email": {
      "main": [
        [
          {
            "node": "Mailchimp - Add Leads Tag",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Type in IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}