{
  "schema_version": "1.0.0",
  "id": "hunter-verify-before-mailchimp",
  "title": "Verify an email with Hunter before it joins Mailchimp",
  "category": "scraping-enrichment",
  "difficulty": "intermediate",
  "featured": false,
  "description": "Check each new address in a sign-up sheet with Hunter, add only deliverable ones to Mailchimp, and mark the rest in the sheet for a person.",
  "tags": [
    "hunter",
    "mailchimp",
    "email-verification",
    "google-sheets"
  ],
  "apps": [
    "Google Sheets",
    "Hunter",
    "Paths by Zapier",
    "Mailchimp"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger",
      "Paths by Zapier"
    ]
  },
  "tasks": {
    "typical": 2,
    "max": 2
  },
  "trigger": {
    "app": "Google Sheets",
    "event": "New Spreadsheet Row",
    "kind": "polling",
    "title": "New sign-up row",
    "why": "Fires for each new sign-up row.",
    "config": {
      "Drive": "My Google Drive",
      "Spreadsheet": "Sign-ups",
      "Worksheet": "Incoming"
    },
    "outputs": [
      "row_number",
      "email",
      "first_name",
      "event",
      "consent"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "verify",
      "kind": "search",
      "app": "Hunter",
      "event": "Verify Email",
      "title": "Verify the address",
      "why": "Hunter checks the address format, the domain's mail server, and whether the mailbox accepts mail.",
      "fields": {
        "Email": "{{trigger.email}}",
        "Should this step be considered a \"success\" when nothing is found?": "Yes"
      },
      "outputs": [
        "result",
        "score",
        "disposable",
        "webmail",
        "_zap_search_was_found_status"
      ]
    },
    {
      "key": "route",
      "kind": "paths",
      "app": "Paths by Zapier",
      "event": "Split into paths",
      "title": "Deliverable or not",
      "why": "Only addresses Hunter calls deliverable go to Mailchimp. Everything else waits for a person.",
      "paths": [
        {
          "name": "Deliverable",
          "conditions": [
            [
              {
                "field": "{{verify.result}}",
                "operator": "(Text) Exactly matches",
                "value": "deliverable"
              },
              {
                "field": "{{trigger.consent}}",
                "operator": "(Text) Exactly matches",
                "value": "yes"
              }
            ]
          ],
          "usually": true,
          "steps": [
            {
              "key": "subscribe",
              "kind": "action",
              "app": "Mailchimp",
              "event": "Add/Update Subscriber",
              "title": "Add the subscriber",
              "why": "Adds or updates the subscriber with a tag for the event they signed up at.",
              "fields": {
                "Audience": "YOUR_MAILCHIMP_AUDIENCE",
                "Subscriber Email": "{{trigger.email}}",
                "Status": "subscribed",
                "First Name": "{{trigger.first_name}}",
                "Tags": "{{trigger.event}}"
              },
              "outputs": [
                "id",
                "status"
              ]
            }
          ]
        },
        {
          "name": "Check by hand",
          "conditions": [
            [
              {
                "field": "{{verify.result}}",
                "operator": "(Text) Does not exactly match",
                "value": "deliverable"
              }
            ]
          ],
          "usually": false,
          "steps": [
            {
              "key": "mark",
              "kind": "action",
              "app": "Google Sheets",
              "event": "Update Spreadsheet Row",
              "title": "Mark the row for review",
              "why": "Writes Hunter's verdict next to the address, so a person can fix the typo or drop the row.",
              "fields": {
                "Drive": "My Google Drive",
                "Spreadsheet": "Sign-ups",
                "Worksheet": "Incoming",
                "Row": "{{trigger.row_number}}",
                "Columns": {
                  "hunter_result": "{{verify.result}}",
                  "hunter_score": "{{verify.score}}",
                  "status": "check address"
                }
              },
              "outputs": [
                "id",
                "row_number"
              ]
            }
          ]
        }
      ]
    }
  ]
}
