{
  "name": "Automated Bulk Emailer",
  "active": false,
  "settings": {},
  "id": "1",
  "nodes": [
    {
      "parameters": {
        "triggerTimes": [
          {
            "hour": 9,
            "minute": 0
          }
        ]
      },
      "name": "Daily 9AM Trigger",
      "type": "n8n-nodes-base.cron",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "operation": "getMany",
        "sheetId": "YOUR_SPREADSHEET_ID_HERE",
        "sheetName": "Sheet1",
        "range": "A2:C",
        "options": {
          "useFirstRowAsHeader": true,
          "returnAll": true
        }
      },
      "name": "Get Contacts",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    },
    {
      "parameters": {
        "batchSize": 1
      },
      "name": "Split In Batches",
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 1,
      "position": [
        650,
        300
      ]
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "keepEmpty": false,
        "values": {
          "string": [
            {
              "name": "toEmail",
              "value": "={{$json[\"Email\"]}}"
            },
            {
              "name": "toName",
              "value": "={{$json[\"Name\"]}}"
            },
            {
              "name": "company",
              "value": "={{$json[\"Company\"]}}"
            },
            {
              "name": "subject",
              "value": "Hi {{$json[\"Name\"]}}, here's an update from {{$json[\"Company\"]}}"
            },
            {
              "name": "htmlBody",
              "value": "<p>Hey {{$json[\"Name\"]}},</p><p>News from {{$json[\"Company\"]}}\u2026</p><p><a href=\\\"https://example.com/unsubscribe?email={{$json[\"Email\"]}}\\\">Unsubscribe</a></p>"
            }
          ],
          "number": [],
          "boolean": []
        }
      },
      "name": "Set Email Data",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        850,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "you@yourdomain.com",
        "toEmail": "={{$node[\"Set Email Data\"].json[\"toEmail\"]}}",
        "subject": "={{$node[\"Set Email Data\"].json[\"subject\"]}}",
        "htmlBody": "={{$node[\"Set Email Data\"].json[\"htmlBody\"]}}"
      },
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 1,
      "position": [
        1050,
        300
      ],
      "credentials": {
        "gmailOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "operation": "append",
        "sheetId": "YOUR_SPREADSHEET_ID_HERE",
        "sheetName": "Logs",
        "range": "A2:C",
        "options": {}
      },
      "name": "Log Results",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 1,
      "position": [
        1250,
        300
      ]
    }
  ],
  "connections": {
    "Daily 9AM Trigger": {
      "main": [
        [
          {
            "node": "Get Contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Contacts": {
      "main": [
        [
          {
            "node": "Split In Batches",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split In Batches": {
      "main": [
        [
          {
            "node": "Set Email Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Email Data": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "main": [
        [
          {
            "node": "Log Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}