{
  "name": "Email Parser \u2192 CRM Update",
  "nodes": [
    {
      "parameters": {
        "operation": "getAll",
        "options": {}
      },
      "id": "imap",
      "name": "IMAP Inbox",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const e=$input.first().json;\nconst name=e.from?.split('<')[0]?.trim()||'';\nconst email=e.from?.match(/<(.+?)>/)?.[1]||e.from;\nreturn {name,email,subject:e.subject,date:e.date};"
      },
      "id": "parse",
      "name": "Parse Signature",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "operation": "create",
        "resource": "contact",
        "properties": {
          "mi": {
            "email": "={{ $json.email }}",
            "firstname": "={{ $json.name }}"
          }
        }
      },
      "id": "hubspot",
      "name": "HubSpot Contact",
      "type": "n8n-nodes-base.hubspot",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    }
  ],
  "connections": {
    "IMAP Inbox": {
      "main": [
        [
          {
            "node": "Parse Signature",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Signature": {
      "main": [
        [
          {
            "node": "HubSpot Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}