{
  "name": "Automate personalized email campaigns with Google Docs, Sheets and SMTP",
  "nodes": [
    {
      "id": "3cc80b37-988e-4111-b9b4-8712a31fe400",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2320,
        -16
      ]
    },
    {
      "id": "f93e671e-f82d-453c-a734-fb144af0c090",
      "name": "contacts",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1872,
        80
      ]
    },
    {
      "id": "bed36d9b-defc-46ce-a6cc-aa8efdddfcc4",
      "name": "template",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        -1760,
        -96
      ]
    },
    {
      "id": "2fb0d6e9-2692-4c4d-b6a7-4d27ba467ef2",
      "name": "updatebody",
      "type": "n8n-nodes-base.set",
      "position": [
        -1184,
        -16
      ]
    },
    {
      "id": "4453d3d8-65d3-4b5c-8083-9c686be44678",
      "name": "settings",
      "type": "n8n-nodes-base.set",
      "position": [
        -2096,
        -16
      ]
    },
    {
      "id": "806753db-3de0-41e2-b43b-aca9dc5f548c",
      "name": "sendemail",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -720,
        0
      ]
    },
    {
      "id": "bd58504e-6a1e-46fd-b892-03853b0ab89b",
      "name": "notemailed",
      "type": "n8n-nodes-base.filter",
      "position": [
        -1648,
        80
      ]
    },
    {
      "id": "fe137938-de01-4542-bbe1-7d605c4ca372",
      "name": "updatecontacts",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -496,
        0
      ]
    },
    {
      "id": "10b636a0-63b8-4215-956f-d66606ae51eb",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -960,
        -16
      ]
    },
    {
      "id": "c1a3e48d-3447-400f-a366-447fb126fb08",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        -272,
        80
      ]
    },
    {
      "id": "463a82ed-2515-4e29-98c8-a091ec62abdf",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -736,
        -208
      ]
    },
    {
      "id": "bc87d9fe-f2d8-4488-b513-9d54d45b989f",
      "name": "merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        -1424,
        -16
      ]
    },
    {
      "id": "706fec26-39d6-4517-849c-bd7ff52c735e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        272
      ],
      "parameters": {
        "width": 176,
        "height": 188,
        "content": "SMTP providers (like OVHcloud) have quota. \nEx: 200 emails / hour  means you can send 3 emails per minute maximum. So, a Wait Amount of 20 seconds is suggested\n"
      }
    },
    {
      "id": "982f0c8d-1cf1-49bf-9a93-0076312c8747",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        272
      ],
      "parameters": {
        "width": 192,
        "height": 188,
        "content": "*row_number* is used for the matching and should contain {{ $('contacts').item.json.row_number }}\n\n*process* is set with {{ $now.format('yyyy-MM-dd, hh:mm:ss a') }}"
      }
    },
    {
      "id": "ed4175e8-5d53-4520-83dc-83f098b4678b",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        272
      ],
      "parameters": {
        "width": 192,
        "height": 188,
        "content": "Update with your own SMTP details and adapt the \"From Email\" field"
      }
    },
    {
      "id": "ac803816-b96d-4d3f-b5e9-ab90c0f6f361",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        -96
      ],
      "parameters": {
        "width": 208,
        "height": 444,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nReplace Google Docs template\n{{firstname}}\n{{lastname}} {{company}}\n{{email}}\nwith real content from the Google Sheet\n\n"
      }
    },
    {
      "id": "1aa209a1-6e65-43e8-a8e3-bb5f539b6702",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1696,
        208
      ],
      "parameters": {
        "width": 192,
        "height": 144,
        "content": "We only select rows with *process* and *err* columns = empty"
      }
    },
    {
      "id": "6b7d9070-e448-437c-9ae0-e52b2a18dcd0",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1808,
        -352
      ],
      "parameters": {
        "width": 192,
        "height": 412,
        "content": "Your Google Docs template containing the message with the \n{{firstname}}\n{{lastname}} {{company}}\n{{email}}\nvariables\n\n[Google Docs Template](https://docs.google.com/document/d/1sR1Mjee0heur6CgEV_ssYz"
      }
    },
    {
      "id": "93ed8856-43da-447c-a85b-a24553468361",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2128,
        160
      ],
      "parameters": {
        "width": 192,
        "height": 192,
        "content": "Set the Subject of your emailing campaign, define the Google Docs & Sheet ID you want to use"
      }
    },
    {
      "id": "1213bc1e-1ce4-4ec0-af5e-53875f2684d9",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        272
      ],
      "parameters": {
        "width": 192,
        "height": 80,
        "content": "\n[Google Sheet Template](https://docs.google.com/spreadsheets/d/1mFKp3wmbV9qp2tpGGsN72zdiC32y8H1nhjdgP885y-U/edit?usp=sharing)\n\n"
      }
    },
    {
      "id": "87eddad8-8c0a-41a0-8f5d-1d2d323382ee",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2368,
        400
      ],
      "parameters": {
        "width": 1376,
        "height": 288,
        "content": "# Emailing using Google Sheet, Google Docs and SMTP\nThis is a simple system to automatise an emailing.\n\n## How it works\n\n- The Google Docs template is your email to be sent and contains the message an"
      }
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "merge": {
      "main": [
        [
          {
            "node": "updatebody",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "contacts": {
      "main": [
        [
          {
            "node": "notemailed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "settings": {
      "main": [
        [
          {
            "node": "template",
            "type": "main",
            "index": 0
          },
          {
            "node": "contacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "template": {
      "main": [
        [
          {
            "node": "merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sendemail": {
      "main": [
        [
          {
            "node": "updatecontacts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "notemailed": {
      "main": [
        [
          {
            "node": "merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "updatebody": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "updatecontacts": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "sendemail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}