8
n8n 中文网amn8n.com

仅使用 n8n 从 Google Sheets 发送个性化邮件和邮件合并

中级

这是一个Social Media, Multimodal AI领域的自动化工作流,包含 8 个节点。主要使用 Set, Gmail, Merge, Filter, GoogleSheets 等节点。 使用 Google Sheets 和 Gmail 进行个性化邮件合并

前置要求
  • Google 账号和 Gmail API 凭证
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "s951UK7G69MAuTHV",
  "meta": {
    "instanceId": "ed404afa2755a61b69581371008dcf7308b475d61d77fc9e20fb5c4f24c38c8a",
    "templateCredsSetupCompleted": true
  },
  "name": "仅使用 n8n 从 Google Sheets 发送个性化邮件和邮件合并",
  "tags": [],
  "nodes": [
    {
      "id": "8d874f7d-9a9a-479f-a51d-eca7dca507af",
      "name": "由 Github 模型提供支持",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "937434fd-cd26-4c6d-b788-99cead31737e",
      "name": "读取 Google Sheets 数据",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        208,
        0
      ],
      "parameters": {
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "fy5lPGj8v8yagDuD",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "2d7f4ab3-6626-4b72-9c23-a4d14d838658",
      "name": "将\"计划发送\"传递给 Gmail",
      "type": "n8n-nodes-base.filter",
      "position": [
        432,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "236cac52-bf68-49e6-adbf-86e7c1470c99",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "",
              "rightValue": "Scheduled for send"
            },
            {
              "id": "029830d9-16ca-40b8-a20e-128c770a4828",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "",
              "rightValue": ""
            },
            {
              "id": "b80dfc3d-8039-43b2-8556-38334afa2093",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "",
              "rightValue": ""
            },
            {
              "id": "368c2ab5-9011-4c85-8c84-0319c246844a",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "",
              "rightValue": ""
            },
            {
              "id": "09783ef6-7231-46fb-8eb2-3a4855374387",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "99dfabeb-05a3-4dd9-a8f5-3ae169f312d1",
      "name": "发送邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        688,
        0
      ],
      "webhookId": "569e80f2-399c-4c06-888b-f43d82fbaa10",
      "parameters": {
        "options": {},
        "emailType": "text"
      },
      "typeVersion": 2.1
    },
    {
      "id": "0758ae59-6c2c-47a9-ae2a-123efd8d70f4",
      "name": "合并两个数据集",
      "type": "n8n-nodes-base.merge",
      "position": [
        928,
        -16
      ],
      "parameters": {
        "mode": "combine",
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "5d7c72f1-5d22-40b0-badf-213220585959",
      "name": "从 Gmail 传递数据",
      "type": "n8n-nodes-base.set",
      "position": [
        1136,
        -16
      ],
      "parameters": {
        "include": "selected",
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3e7a0b30-eecb-4a59-b49a-2434bb27fbc9",
              "name": "",
              "type": "string",
              "value": ""
            },
            {
              "id": "226aec82-7ad2-4d80-b65f-5b44a6bf0e75",
              "name": "",
              "type": "string",
              "value": ""
            },
            {
              "id": "4f1b496e-ba43-4dbd-8fd0-7271d7d13aff",
              "name": "",
              "type": "string",
              "value": ""
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "28266b4f-55f2-46c0-bbe8-c47af0f62d6a",
      "name": "更新状态邮件列",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1360,
        -16
      ],
      "parameters": {
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "fy5lPGj8v8yagDuD",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "dc668bea-e4e3-40f4-be8e-274b23a7ed33",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -400
      ],
      "parameters": {
        "color": 4,
        "width": 1456,
        "height": 320,
        "content": "## 从 Google Sheets 进行邮件合并或发送邮件"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "76d6078e-16bf-463c-bef5-5e78033fcaf7",
  "connections": {
    "Send an email": {
      "main": [
        [
          {
            "node": "Combine both datasets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Read Google Sheets data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass data from Gmail": {
      "main": [
        [
          {
            "node": "Update Status email column",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Combine both datasets": {
      "main": [
        [
          {
            "node": "Pass data from Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Google Sheets data": {
      "main": [
        [
          {
            "node": "Pass on \"Scheduled for send\" to Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pass on \"Scheduled for send\" to Gmail": {
      "main": [
        [
          {
            "node": "Send an email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Combine both datasets",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - 社交媒体, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量8
分类2
节点类型7
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Ladies Build With AI

Ladies Build With AI

@ladiesbuildwithai

We teach online AI coding classes for women to go from zero to AI Builder in just 3 days.

外部链接
在 n8n.io 查看

分享此工作流