8
n8n 中文网amn8n.com

客户入职邮件验证

高级

这是一个Content Creation, Multimodal AI领域的自动化工作流,包含 21 个节点。主要使用 If, Code, Gmail, Slack, Webhook 等节点。 使用VerifiEmail、Gmail和Slack的自动化邮件验证与入职流程

前置要求
  • Google 账号和 Gmail API 凭证
  • Slack Bot Token 或 Webhook URL
  • HTTP Webhook 端点(n8n 会自动生成)
  • Google Sheets API 凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "0l3nj6SM84lw3lvH",
  "meta": {
    "instanceId": "",
    "templateCredsSetupCompleted": false
  },
  "name": "客户入职邮件验证",
  "tags": [],
  "nodes": [
    {
      "id": "86910847-a9b7-4a7d-9ed0-259e9fb0b880",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -80,
        0
      ],
      "webhookId": "",
      "parameters": {
        "path": "/new-signup",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "e834db7e-1dc7-4ee5-8ac4-1be83f1a4041",
      "name": "数据清理",
      "type": "n8n-nodes-base.code",
      "position": [
        176,
        0
      ],
      "parameters": {
        "jsCode": "// Handle different input structures safely\nconst items = $input.all();\n\nreturn items.map(item => {\n  // Try different possible data structures\n  const data = item.json.body || item.json || {};\n  \n  // Safe access with fallbacks\n  const name = (data.name || '').trim();\n  const email = (data.email || '').toLowerCase().trim();\n  \n  // Validation\n  if (!name || !email) {\n    throw new Error(`Missing required fields. Received: ${JSON.stringify(data)}`);\n  }\n  \n  return {\n    json: {\n      name: name,\n      email: email,\n      original_email: data.email || email,\n      received_at: new Date().toISOString()\n    }\n  };\n});"
      },
      "typeVersion": 2
    },
    {
      "id": "f0ccbc6e-9c10-47b3-bd2e-fb06a1f3615d",
      "name": "邮件验证",
      "type": "n8n-nodes-verifiemail.verifiEmail",
      "position": [
        496,
        0
      ],
      "parameters": {
        "email": "={{ $json.email }}"
      },
      "credentials": {
        "verifiEmailApi": {
          "id": "",
          "name": "VerifiEmail API"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "7fa85889-6906-4637-8bcb-d2ec30370fda",
      "name": "验证决策",
      "type": "n8n-nodes-base.if",
      "position": [
        800,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "35f8b0f1-c001-46e2-a4f1-f7d5bb7b2b24",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.valid }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "1c045477-d1eb-4bc7-a006-fd87321ddbb4",
      "name": "个性化欢迎邮件",
      "type": "n8n-nodes-base.code",
      "position": [
        1072,
        -96
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Get data from previous nodes\nconst name = $('Data Sanitization').item.json.name;\nconst email = $('Data Sanitization').item.json.email;\nconst firstName = name.split(' ')[0];\n\n// Get validation details (optional - for logging)\nconst validationScore = $json.quality_score || 'N/A';\n\nreturn {\n  json: {\n    name: name,\n    firstName: firstName,\n    email: email,\n    subject: `Welcome to Our Platform, ${firstName}! 🎉`,\n    emailBody: `\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n</head>\n<body style=\"margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f4f4f4;\">\n  <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: #f4f4f4; padding: 20px;\">\n    <tr>\n      <td align=\"center\">\n        <table width=\"600\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: #ffffff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.1);\">\n          \n          <!-- Header -->\n          <tr>\n            <td style=\"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 40px 20px; text-align: center;\">\n              <h1 style=\"color: #ffffff; margin: 0; font-size: 28px;\">Welcome, ${firstName}! 🎉</h1>\n            </td>\n          </tr>\n          \n          <!-- Content -->\n          <tr>\n            <td style=\"padding: 40px 30px;\">\n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0 0 20px 0;\">\n                Hi <strong>${firstName}</strong>,\n              </p>\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0 0 20px 0;\">\n                Thank you for joining us! We're thrilled to have you as part of our community.\n              </p>\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0 0 30px 0;\">\n                Here's what you can do next:\n              </p>\n              \n              <!-- Action Buttons -->\n              <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-bottom: 30px;\">\n                <tr>\n                  <td style=\"padding: 10px 0;\">\n                    <a href=\"https://yourapp.com/dashboard\" style=\"display: inline-block; background-color: #667eea; color: #ffffff; text-decoration: none; padding: 14px 30px; border-radius: 5px; font-weight: bold; font-size: 16px;\">\n                      📊 Access Your Dashboard\n                    </a>\n                  </td>\n                </tr>\n                <tr>\n                  <td style=\"padding: 10px 0;\">\n                    <a href=\"https://yourapp.com/getting-started\" style=\"display: inline-block; background-color: #48bb78; color: #ffffff; text-decoration: none; padding: 14px 30px; border-radius: 5px; font-weight: bold; font-size: 16px;\">\n                      📚 Getting Started Guide\n                    </a>\n                  </td>\n                </tr>\n                <tr>\n                  <td style=\"padding: 10px 0;\">\n                    <a href=\"https://yourapp.com/support\" style=\"display: inline-block; background-color: #ed8936; color: #ffffff; text-decoration: none; padding: 14px 30px; border-radius: 5px; font-weight: bold; font-size: 16px;\">\n                      💬 Contact Support\n                    </a>\n                  </td>\n                </tr>\n              </table>\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0 0 10px 0;\">\n                Questions? Just reply to this email - we're here to help!\n              </p>\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0;\">\n                Best regards,<br>\n                <strong>The Team</strong>\n              </p>\n            </td>\n          </tr>\n          \n          <!-- Footer -->\n          <tr>\n            <td style=\"background-color: #f7fafc; padding: 20px 30px; text-align: center; border-top: 1px solid #e2e8f0;\">\n              <p style=\"font-size: 12px; color: #718096; margin: 0;\">\n                © 2025 Your Company. All rights reserved.\n              </p>\n            </td>\n          </tr>\n          \n        </table>\n      </td>\n    </tr>\n  </table>\n</body>\n</html>\n    `,\n    timestamp: new Date().toISOString(),\n    status: 'verified',\n    validationScore: validationScore\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "090efe61-fd58-400b-935b-70291bb3595e",
      "name": "准备更正邮件",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        176
      ],
      "parameters": {
        "jsCode": "const name = $('Data Sanitization').item.json.name;\nconst email = $('Data Sanitization').item.json.email;\nconst firstName = name.split(' ')[0];\n\n// Get validation reason\nconst validationData = $json;\nconst reason = validationData.deliverability || 'invalid';\n\n// Simple typo detection\nlet suggestion = '';\nconst commonTypos = {\n  'gmial': 'gmail',\n  'gmai': 'gmail',\n  'yahooo': 'yahoo',\n  'yaho': 'yahoo',\n  'hotmial': 'hotmail',\n  'outlok': 'outlook',\n  'outloo': 'outlook'\n};\n\nfor (const [typo, correct] of Object.entries(commonTypos)) {\n  if (email.includes(typo)) {\n    suggestion = email.replace(typo, correct);\n    break;\n  }\n}\n\nreturn {\n  json: {\n    name: name,\n    firstName: firstName,\n    email: email,\n    suggestion: suggestion,\n    reason: reason,\n    subject: `Please verify your email address`,\n    emailBody: `\n<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n</head>\n<body style=\"margin: 0; padding: 0; font-family: Arial, sans-serif; background-color: #f4f4f4;\">\n  <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: #f4f4f4; padding: 20px;\">\n    <tr>\n      <td align=\"center\">\n        <table width=\"600\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: #ffffff; border-radius: 8px; overflow: hidden;\">\n          \n          <!-- Header -->\n          <tr>\n            <td style=\"background-color: #f56565; padding: 30px 20px; text-align: center;\">\n              <h1 style=\"color: #ffffff; margin: 0; font-size: 24px;\">⚠️ Email Verification Issue</h1>\n            </td>\n          </tr>\n          \n          <!-- Content -->\n          <tr>\n            <td style=\"padding: 40px 30px;\">\n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0 0 20px 0;\">\n                Hi <strong>${firstName}</strong>,\n              </p>\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0 0 20px 0;\">\n                We attempted to verify your email address but encountered an issue:\n              </p>\n              \n              <div style=\"background-color: #fff5f5; border-left: 4px solid #f56565; padding: 15px; margin: 20px 0;\">\n                <p style=\"margin: 0; color: #742a2a; font-family: monospace;\">\n                  <strong>Email entered:</strong> ${email}\n                </p>\n              </div>\n              \n              ${suggestion ? `\n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 20px 0;\">\n                Did you mean: <strong style=\"color: #48bb78;\">${suggestion}</strong>?\n              </p>\n              ` : ''}\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 20px 0;\">\n                Please double-check your email address and try again:\n              </p>\n              \n              <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">\n                <tr>\n                  <td style=\"padding: 20px 0; text-align: center;\">\n                    <a href=\"https://yourapp.com/signup\" style=\"display: inline-block; background-color: #4299e1; color: #ffffff; text-decoration: none; padding: 14px 40px; border-radius: 5px; font-weight: bold; font-size: 16px;\">\n                      Try Again\n                    </a>\n                  </td>\n                </tr>\n              </table>\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 20px 0;\">\n                Need help? <a href=\"https://yourapp.com/support\" style=\"color: #4299e1;\">Contact our support team</a>.\n              </p>\n              \n              <p style=\"font-size: 16px; line-height: 1.6; color: #333333; margin: 0;\">\n                Best regards,<br>\n                <strong>The Team</strong>\n              </p>\n            </td>\n          </tr>\n          \n          <!-- Footer -->\n          <tr>\n            <td style=\"background-color: #f7fafc; padding: 20px 30px; text-align: center;\">\n              <p style=\"font-size: 12px; color: #718096; margin: 0;\">\n                © 2025 Your Company\n              </p>\n            </td>\n          </tr>\n          \n        </table>\n      </td>\n    </tr>\n  </table>\n</body>\n</html>\n    `,\n    status: 'invalid',\n    timestamp: new Date().toISOString()\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "3fb1d01c-b57d-4f0d-b160-5ed16f4ff5e5",
      "name": "团队通知",
      "type": "n8n-nodes-base.slack",
      "position": [
        1968,
        -96
      ],
      "webhookId": "",
      "parameters": {
        "text": "=🎉 *New Verified Signup!*\n👤 *Name:* {{ $('Personalize Welcome Email').item.json.name }}\n📧 *Email:* {{ $('Personalize Welcome Email').item.json.email }}\n⏰ *Time:* {{ $('Personalize Welcome Email').item.json.timestamp }}\n✅ *Status:* Verified & Welcomed",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "new-signup"
        },
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "id": "",
          "name": "Slack Workspace"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "d42409be-e1c4-41e0-8114-4d59aaccea1e",
      "name": "记录有效用户",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1536,
        -96
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('Personalize Welcome Email').item.json.name }}",
            "Email": "={{ $('Personalize Welcome Email').item.json.email }}",
            " Status": "={{ $('Personalize Welcome Email').item.json.status }}",
            "Verified At": "={{ $('Personalize Welcome Email').item.json.timestamp }}",
            "Original Email": "={{ $('Data Sanitization').item.json.original_email }}",
            "Validation Score": "={{ $('Personalize Welcome Email').item.json.validationScore }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": " Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": " Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Verified At",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Verified At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Original Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Original Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Validation Score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Validation Score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultName": "Verified Users"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets Account"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "9e8d198e-2cda-4ff3-8cda-3bfc909444b5",
      "name": "发送欢迎邮件",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1328,
        -96
      ],
      "webhookId": "",
      "parameters": {
        "sendTo": "={{ $json.email }}",
        "message": "={{ $json.emailBody }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "",
          "name": "Gmail Account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "04369699-c5d2-4948-96ea-47e74919fe9a",
      "name": "停止并报错",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        1472,
        176
      ],
      "parameters": {
        "errorMessage": "\"Invalid email address\""
      },
      "typeVersion": 1
    },
    {
      "id": "b03ea9e9-1f92-4858-b2ae-e39f4ad2fe83",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -752,
        -112
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 368,
        "content": "## 客户入职邮件验证工作流"
      },
      "typeVersion": 1
    },
    {
      "id": "528bf108-604f-4242-8b99-1990ea3e682e",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        -448
      ],
      "parameters": {
        "color": 7,
        "width": 304,
        "height": 576,
        "content": "## WEBHOOK 触发器"
      },
      "typeVersion": 1
    },
    {
      "id": "b06d93a6-c7d8-4983-8393-f3df19536dda",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        80,
        -480
      ],
      "parameters": {
        "color": 7,
        "width": 304,
        "height": 608,
        "content": "## 数据清理"
      },
      "typeVersion": 1
    },
    {
      "id": "99f39f7d-8b0d-49b4-81a7-cc691caba8bb",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        -416
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 576,
        "content": "## 邮件验证 (VerifiEmail)"
      },
      "typeVersion": 1
    },
    {
      "id": "878cf3ea-e3e7-4e87-a4e3-6a209497ec1b",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        736,
        -320
      ],
      "parameters": {
        "color": 7,
        "height": 448,
        "content": "## 验证决策点"
      },
      "typeVersion": 1
    },
    {
      "id": "b9b68238-69ee-4542-ab77-1503382c235d",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        -432
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 480,
        "content": "## 个性化邮件"
      },
      "typeVersion": 1
    },
    {
      "id": "9d7e44a0-3e33-4e27-9e91-508b1704f6e4",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1488,
        -448
      ],
      "parameters": {
        "color": 7,
        "height": 496,
        "content": "## 记录到 Sheets"
      },
      "typeVersion": 1
    },
    {
      "id": "d249ffe4-fb29-4c93-8146-bba14304ff66",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1792,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 304,
        "height": 432,
        "content": "## SLACK 警报"
      },
      "typeVersion": 1
    },
    {
      "id": "0d82df0e-bcef-478e-a58c-8d0562f40fc0",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        160
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 480,
        "content": "## 停止和错误"
      },
      "typeVersion": 1
    },
    {
      "id": "e76c5aeb-c342-4e9e-81ec-ad9d0330eeab",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 288,
        "height": 384,
        "content": "## 维护"
      },
      "typeVersion": 1
    },
    {
      "id": "f177dd8d-ba9e-4b74-816e-385b34a0da5d",
      "name": "便签10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 304,
        "height": 496,
        "content": "## 快速参考"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f6a13975-f0ea-4d5f-9df3-77b8adbc172b",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Data Sanitization",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Valid Users": {
      "main": [
        [
          {
            "node": "Team Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Validation": {
      "main": [
        [
          {
            "node": "Validation Decision",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Sanitization": {
      "main": [
        [
          {
            "node": "Email Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Welcome Email": {
      "main": [
        [
          {
            "node": "Log Valid Users",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validation Decision": {
      "main": [
        [
          {
            "node": "Personalize Welcome Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Correction Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Correction Email": {
      "main": [
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Personalize Welcome Email": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 内容创作, 多模态 AI

需要付费吗?

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

工作流信息
难度等级
高级
节点数量21
分类2
节点类型9
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Jitesh Dugar

Jitesh Dugar

@jiteshdugar

AI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.

外部链接
在 n8n.io 查看

分享此工作流