8
n8n 中文网amn8n.com

新闻通讯管理 (n8n + Bolt.new)

高级

这是一个AI, Marketing领域的自动化工作流,包含 43 个节点。主要使用 If, Code, Gmail, Merge, Webhook 等节点,结合人工智能技术实现智能自动化。 职位通讯自动化系统 (N8N, Bolt.new, RapidAPI, Mails.so & ChatGPT)

前置要求
  • Google 账号和 Gmail API 凭证
  • HTTP Webhook 端点(n8n 会自动生成)
  • 可能需要目标 API 的认证凭证
  • Google Sheets API 凭证
  • OpenAI API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "ypa8bWM40du6QADu",
  "meta": {
    "instanceId": "b3c467df4053d13fe31cc98f3c66fa1d16300ba750506bfd019a0913cec71ea3",
    "templateCredsSetupCompleted": true
  },
  "name": "新闻通讯管理 (n8n + Bolt.new)",
  "tags": [],
  "nodes": [
    {
      "id": "e125e5b8-eb83-4907-a149-6975df76fc80",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -280,
        0
      ],
      "webhookId": "5ec8dcf6-b2ba-4fb3-bf62-d253d2f39f02",
      "parameters": {
        "path": "5ec8dcf6-b2ba-4fb3-bf62-d253d2f39f02",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "7e5fd2a0-5e1b-461c-b24d-bacd248bd471",
      "name": "确认邮箱有效性",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        380,
        180
      ],
      "parameters": {
        "url": "=https://api.mails.so/v1/validate?email={{ $('Webhook').item.json.body.email }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-mails-api-key",
              "value": "\"your-api-key\""
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "fc0c24fd-8243-4892-862e-61d31d62ac0e",
      "name": "发送邮件1",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        380,
        -160
      ],
      "webhookId": "d8073085-1413-40df-9d78-d7b6190c8101",
      "parameters": {
        "html": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>You're Already Subscribed</title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      background-color: #f4f7fa;\n      margin: 0;\n      padding: 0;\n    }\n    .container {\n      max-width: 600px;\n      margin: 40px auto;\n      background-color: #ffffff;\n      padding: 40px;\n      border-radius: 10px;\n      box-shadow: 0 10px 30px rgba(0,0,0,0.05);\n    }\n    .header {\n      text-align: center;\n      padding-bottom: 20px;\n    }\n    .header h1 {\n      color: #2d3748;\n      font-size: 22px;\n      margin-bottom: 10px;\n    }\n    .content {\n      font-size: 16px;\n      color: #4a5568;\n      line-height: 1.6;\n    }\n    .footer {\n      margin-top: 40px;\n      font-size: 12px;\n      text-align: center;\n      color: #a0aec0;\n    }\n    .footer a {\n      color: #2b6cb0;\n      text-decoration: none;\n    }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>You're Already Subscribed</h1>\n    </div>\n    <div class=\"content\">\n      <p>Hi there,</p>\n      <p>It looks like someone recently tried to subscribe <strong>your email</strong> to the Jobs 4 U Newsletter.</p>\n      <p>You're already on our list — no further action is needed!</p>\n      <p>If you did not initiate this request, feel free to ignore this email. Your subscription status has not changed.</p>\n      <p>Thank you for staying with us — great opportunities are always heading your way. 🚀</p>\n    </div>\n    <div class=\"footer\">\n      <p>Review our \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app//terms\" target=\"_blank\">Terms & Conditions</a> and \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app//privacy\" target=\"_blank\">Privacy Policy</a>.\n      </p>\n    </div>\n  </div>\n</body>\n</html>\n",
        "options": {},
        "subject": "Already Subscribed to Jobs 4 U",
        "toEmail": "={{ $('Webhook').item.json.body.email }}",
        "fromEmail": "\"your-from-email\""
      },
      "credentials": {
        "smtp": {
          "id": "xcnAVXwtuOa1IOqE",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c14789f7-06b6-42de-8459-7fd7a30a4b38",
      "name": "条件判断1",
      "type": "n8n-nodes-base.if",
      "position": [
        580,
        180
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "or",
          "conditions": [
            {
              "id": "bc3200af-7ae4-4944-b410-ebb459e2d927",
              "operator": {
                "type": "string",
                "operation": "notContains"
              },
              "leftValue": "={{ $json.data.result }}",
              "rightValue": "undeliverable"
            },
            {
              "id": "b0c7d1c3-a733-4547-899e-ff76b66765ad",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.data.mx_record }}",
              "rightValue": "[null]"
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "3b23881d-e393-4686-9356-aa43e08611bf",
      "name": "合并",
      "type": "n8n-nodes-base.merge",
      "position": [
        1140,
        -160
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.1
    },
    {
      "id": "82960352-541b-49a6-b1f7-114583be0feb",
      "name": "计划触发器",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -300,
        1200
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "a246e968-15be-4492-bbc1-c99a5937d794",
      "name": "分离输出",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        540,
        1040
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "jobs"
      },
      "executeOnce": false,
      "typeVersion": 1
    },
    {
      "id": "a284e406-f403-4837-abf9-e770d222f773",
      "name": "合并1",
      "type": "n8n-nodes-base.merge",
      "position": [
        1640,
        1180
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "executeOnce": false,
      "typeVersion": 3.1
    },
    {
      "id": "e8a459f4-e498-42b8-a901-e107864e260c",
      "name": "聚合",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1320,
        1040
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "ad32bd78-a7f9-4225-9a8b-410330a5c043",
      "name": "聚合1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1220,
        1320
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "ff46019a-9524-4d0c-954b-4a796c531534",
      "name": "Webhook1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -280,
        660
      ],
      "webhookId": "709bb303-2c56-456a-b039-db5254c14328",
      "parameters": {
        "path": "709bb303-2c56-456a-b039-db5254c14328",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "347f8cbe-52f4-4f99-81d0-99e93c4860fc",
      "name": "获取所有订阅者表中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -60,
        660
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.body.email }}",
              "lookupColumn": "Email Address"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=0",
          "cachedResultName": "All Subscribers"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "de531168-450e-4177-9c88-6bdeb51170b8",
      "name": "将状态改为退订",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        160,
        660
      ],
      "parameters": {
        "columns": {
          "value": {
            "Email Address": "={{ $json['Email Address'] }}",
            "Subscription Status": "Unsubscribed"
          },
          "schema": [
            {
              "id": "Email Address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subscribe Date",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Subscribe Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subscription Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Subscription Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email Address"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=0",
          "cachedResultName": "All Subscribers"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "6202d3eb-4f86-4b19-84c9-50a02f136cac",
      "name": "添加到退订表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        380,
        660
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('get rows in all subscribers sheet').item.json.Name }}",
            "Email Address": "={{ $json['Email Address'] }}"
          },
          "schema": [
            {
              "id": "Email Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1629686868,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=1629686868",
          "cachedResultName": "Unsubscribed"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "e567a35a-83be-48aa-bca6-7f560b18ad0a",
      "name": "获取订阅表中的行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        600,
        660
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json['Email Address'] }}",
              "lookupColumn": "Email Address"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1253191037,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=1253191037",
          "cachedResultName": "Subscribed"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "1fad75fe-83a6-4a1d-a235-0890cbc7932f",
      "name": "从订阅表中删除行",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        820,
        660
      ],
      "parameters": {
        "operation": "delete",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1253191037,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=1253191037",
          "cachedResultName": "Subscribed"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        },
        "startIndex": "={{ $json.row_number }}"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "150912ac-0735-4e09-a04e-4dfa2e98def8",
      "name": "获取订阅者列表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -120,
        1200
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1253191037,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=1253191037",
          "cachedResultName": "Subscribed"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5,
      "alwaysOutputData": true
    },
    {
      "id": "3f79310b-2609-43b7-b5f4-9b355b9dd5aa",
      "name": "获取职位信息",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        320,
        1040
      ],
      "parameters": {
        "url": "https://jobs-search-api.p.rapidapi.com/getjobs",
        "method": "POST",
        "options": {},
        "jsonBody": "{\n  \"search_term\": \"product manager\",\n  \"location\": \"remote\",\n  \"results_wanted\": 10,\n  \"site_name\": [\n    \"indeed\",\n    \"linkedin\",\n    \"zip_recruiter\",\n    \"glassdoor\"\n  ],\n  \"distance\": 0,\n  \"job_type\": \"fulltime\",\n  \"is_remote\": true,\n  \"linkedin_fetch_description\": true,\n  \"hours_old\": 24\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "jobs-search-api.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "\"your-rapid-api-key\""
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "59c28a80-2863-4a60-b846-5fbf02507140",
      "name": "汇总职位描述",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        960,
        1040
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-3.5-turbo",
          "cachedResultName": "GPT-3.5-TURBO"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "content": "=Summarize this job description to one sentences: {{ $json.description }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "DO9F6MAeTGLeqgoF",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "6fb33d05-c609-460a-8302-e87628380bc4",
      "name": "格式化新闻通讯",
      "type": "n8n-nodes-base.code",
      "position": [
        1820,
        1180
      ],
      "parameters": {
        "jsCode": "// HTML Newsletter Generation Function for n8n\n// This function formats the aggregated job data into an HTML newsletter\n\nfunction generateNewsletter() {\n  // Get current date for the newsletter\n  const currentDate = new Date().toLocaleDateString('en-US', {\n    weekday: 'long',\n    year: 'numeric',\n    month: 'long',\n    day: 'numeric'\n  });\n  \n  // Start building the HTML newsletter\n  let htmlContent = `\n  <!DOCTYPE html>\n  <html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Job Opportunities Newsletter</title>\n    <style>\n      body {\n        font-family: Arial, sans-serif;\n        line-height: 1.6;\n        color: #333;\n        max-width: 800px;\n        margin: 0 auto;\n        padding: 20px;\n      }\n      .header {\n        background-color: #0066cc;\n        color: white;\n        padding: 20px;\n        text-align: center;\n        border-radius: 5px 5px 0 0;\n      }\n      .job-listing {\n        border: 1px solid #ddd;\n        padding: 15px;\n        margin-bottom: 20px;\n        border-radius: 5px;\n        background-color: #f9f9f9;\n      }\n      .job-title {\n        color: #0066cc;\n        margin-top: 0;\n        margin-bottom: 5px;\n        font-size: 18px;\n      }\n      .job-company {\n        font-weight: bold;\n        margin-bottom: 5px;\n      }\n      .job-details {\n        margin-bottom: 10px;\n        font-size: 14px;\n        color: #666;\n      }\n      .job-description {\n        margin-bottom: 15px;\n      }\n      .job-salary {\n        font-weight: bold;\n        color: #4CAF50;\n      }\n      .job-link {\n        display: inline-block;\n        background-color: #0066cc;\n        color: white;\n        padding: 8px 15px;\n        text-decoration: none;\n        border-radius: 3px;\n        margin-top: 10px;\n      }\n      .job-link:hover {\n        background-color: #004c99;\n      }\n      .footer {\n        background-color: #f5f5f5;\n        border-top: 1px solid #ddd;\n        padding: 20px;\n        margin-top: 30px;\n        border-radius: 0 0 5px 5px;\n      }\n      .footer-logo {\n        text-align: center;\n        margin-bottom: 15px;\n      }\n      .footer-logo a {\n        color: #0066cc;\n        font-size: 24px;\n        font-weight: bold;\n        text-decoration: none;\n      }\n      .footer-links {\n        text-align: center;\n        margin-bottom: 15px;\n      }\n      .footer-links a {\n        color: #666;\n        text-decoration: none;\n        margin: 0 15px;\n        font-size: 14px;\n      }\n      .footer-links a:hover {\n        text-decoration: underline;\n      }\n      .unsubscribe {\n        text-align: center;\n        font-size: 12px;\n        color: #999;\n      }\n      .unsubscribe a {\n        color: #999;\n        text-decoration: underline;\n      }\n    </style>\n  </head>\n  <body>\n    <div class=\"header\">\n      <h1>Top Job Opportunities</h1>\n      <p>${currentDate}</p>\n    </div>\n    <div class=\"content\">\n      <p>Hello ${$('Get Subscribers').first().json.Name}, here are the latest Jobs 4 U:</p>\n  `;\n  \n  // Loop through each job (0 to 9) to add to the newsletter\n  for (let i = 0; i < 10; i++) {\n    // Only include jobs that actually exist in the data\n    if ($('Aggregate1').first().json.data[i] && $('Aggregate1').first().json.data[i].title) {\n      // Get job details from Aggregate1 node\n      const title = $('Aggregate1').first().json.data[i].title || 'No Title';\n      const company = $('Aggregate1').first().json.data[i].company || 'Company not specified';\n      const location = $('Aggregate1').first().json.data[i].location || 'Location not specified';\n      const currency = $('Aggregate1').first().json.data[i].currency || '';\n      const minAmount = $('Aggregate1').first().json.data[i].min_amount || 'Not specified';\n      const maxAmount = $('Aggregate1').first().json.data[i].max_amount || 'Not specified';\n      const datePosted = $('Aggregate1').first().json.data[i].date_posted || 'Date not specified';\n      const jobUrl = $('Aggregate1').first().json.data[i].job_url || '#';\n      \n      // Get job description from Aggregate node\n      const description = $('Aggregate').first().json.data[i]?.message?.content || 'No description available';\n      \n      // Add this job to the HTML content\n      htmlContent += `\n        <div class=\"job-listing\">\n          <h2 class=\"job-title\">${title}</h2>\n          <div class=\"job-company\">${company}</div>\n          <div class=\"job-details\">\n            <span>${location}</span> • \n            <span>Posted: ${datePosted}</span>\n          </div>\n          <div class=\"job-description\">\n            ${description}\n          </div>\n          <div class=\"job-salary\">\n            Salary: ${currency}${minAmount} - ${currency}${maxAmount}\n          </div>\n          <a href=\"${jobUrl}\" class=\"job-link\" target=\"_blank\">Apply Now</a>\n        </div>\n      `;\n    }\n  }\n  \n  // Add the improved footer\n  htmlContent += `\n      <div class=\"footer\">\n        <div class=\"footer-logo\">\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/\">Job 4 U</a>\n        </div>\n        <div class=\"footer-links\">\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/terms\">Terms of Service</a>\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/privacy\">Privacy Policy</a>\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/\">Contact Us</a>\n        </div>\n        <div class=\"unsubscribe\">\n          <p>Don't want to receive these emails? <a href=\"https://magnificent-tanuki-11356e.netlify.app/unsubscribe?email=${$('Get Subscribers').first().json['Email Address']}\">Unsubscribe</a></p>\n        </div>\n      </div>\n    </div>\n  </body>\n  </html>\n  `;\n  \n  // Return the formatted HTML newsletter\n  return { htmlNewsletter: htmlContent };\n}\n\n// Return the generated newsletter\nreturn generateNewsletter();"
      },
      "typeVersion": 2
    },
    {
      "id": "f4814333-4ec8-4dc0-bedc-df24f54d5abe",
      "name": "获取所有订阅者",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -60,
        0
      ],
      "parameters": {
        "options": {},
        "filtersUI": {
          "values": [
            {
              "lookupValue": "={{ $json.body.email }}",
              "lookupColumn": "Email Address"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=0",
          "cachedResultName": "All Subscribers"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5,
      "alwaysOutputData": true
    },
    {
      "id": "419bfccb-9d98-4a62-961b-a537ffbc121f",
      "name": "如果邮箱已在数据库中",
      "type": "n8n-nodes-base.if",
      "position": [
        160,
        0
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3a5acb6e-d1bb-4b9b-b5db-a0ba52910750",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.row_number }}",
              "rightValue": ""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "62936656-05ba-4492-9cb3-e924c510c689",
      "name": "发送欢迎邮件",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        780,
        -320
      ],
      "webhookId": "29812df7-d962-495a-b1fe-f755968dc932",
      "parameters": {
        "html": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Welcome to Jobs 4 U Newsletter</title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      background-color: #f4f7fa;\n      margin: 0;\n      padding: 0;\n    }\n    .container {\n      max-width: 600px;\n      margin: 40px auto;\n      background-color: #ffffff;\n      padding: 40px;\n      border-radius: 10px;\n      box-shadow: 0 10px 30px rgba(0,0,0,0.05);\n    }\n    .header {\n      text-align: center;\n      padding-bottom: 20px;\n    }\n    .header h1 {\n      color: #2d3748;\n      font-size: 24px;\n      margin-bottom: 10px;\n    }\n    .content {\n      font-size: 16px;\n      color: #4a5568;\n      line-height: 1.6;\n    }\n    .button {\n      display: inline-block;\n      margin-top: 20px;\n      padding: 12px 24px;\n      background-color: #2b6cb0;\n      color: white;\n      text-decoration: none;\n      border-radius: 6px;\n      font-weight: bold;\n    }\n    .footer {\n      margin-top: 40px;\n      font-size: 12px;\n      text-align: center;\n      color: #a0aec0;\n    }\n    .footer a {\n      color: #2b6cb0;\n      text-decoration: none;\n    }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>Welcome to the Jobs Newsletter!</h1>\n    </div>\n    <div class=\"content\">\n      <p>Hi {{ $('Webhook').item.json.body.name }},</p>\n      <p>Thanks for subscribing to the <strong>Jobs 4 U Newsletter</strong>! 🧑‍💻</p>\n      <p>Each week, you'll receive handpicked job opportunities straight to your inbox — from remote roles to top-tier tech companies looking for talent just like you.</p>\n      <p>Stay tuned and keep an eye on your inbox. We’re excited to help you take the next step in your career!</p>\n      <p>If you ever want to unsubscribe, you can do so at the bottom of any email we send.</p>\n    </div>\n    <div class=\"footer\">\n      <p>By subscribing, you agree to our \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app/terms\" target=\"_blank\">Terms & Conditions</a> and \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app/privacy\" target=\"_blank\">Privacy Policy</a>.\n      </p>\n      <p>Happy job hunting! 🚀</p>\n    </div>\n  </div>\n</body>\n</html>\n",
        "options": {
          "appendAttribution": false
        },
        "subject": "Welcome to Jobs 4 U Newsletter",
        "toEmail": "={{ $('Webhook').item.json.body.email }}",
        "fromEmail": "\"your-from-email\""
      },
      "credentials": {
        "smtp": {
          "id": "xcnAVXwtuOa1IOqE",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f0e80aea-bd08-4a58-b8ae-89782a9662a5",
      "name": "将邮箱添加到所有订阅者表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        780,
        -160
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('Webhook').item.json.body.name }}",
            "Email Address": "={{ $('Webhook').item.json.body.email }}",
            "Subscribe Date": "={{ $now.toFormat('yyyy-MM-dd') }}",
            "Subscription Status": "Subscribed"
          },
          "schema": [
            {
              "id": "Email Address",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subscribe Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Subscribe Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Subscription Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Subscription Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=0",
          "cachedResultName": "All Subscribers"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "cb8d80f2-06d5-4409-a896-e802cc32dab5",
      "name": "将邮箱添加到订阅表",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        780,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('Webhook').item.json.body.name }}",
            "Email Address": "={{ $('Webhook').item.json.body.email }}"
          },
          "schema": [
            {
              "id": "Email Address",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Email Address",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Email Address"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 1253191037,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit#gid=1253191037",
          "cachedResultName": "Subscribed"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1jSVIqvy74zfz106k-16tFCFTU-l2c5buNxHvKKBgQCw/edit?usp=drivesdk",
          "cachedResultName": "Jobs 4 U Newsletter"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "d0qeLhShx9sGXalR",
          "name": "Google Sheets"
        }
      },
      "typeVersion": 4.5
    },
    {
      "id": "5a877277-10be-4076-887d-f23477222dbb",
      "name": "已存在通知",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        540,
        -320
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "=Email Already Exists!\nHello  {{ $('Webhook').item.json.body.name }}, your email '{{ $('Webhook').item.json.body.email }}' already exists on our database."
      },
      "typeVersion": 1.2
    },
    {
      "id": "51152701-7da3-499e-84dc-eb3fda51cc50",
      "name": "无效邮箱通知",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        780,
        280
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "=Invalid Email! \nHi {{ $('Webhook').item.json.body.name }}, we are unable to process this email \"{{ $('Webhook').item.json.body.email }}\" and add it to our subscribers database. Please confirm if it right."
      },
      "typeVersion": 1.2
    },
    {
      "id": "dc2166ef-eb75-4203-a88a-6d10009eb19e",
      "name": "订阅成功通知",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1340,
        -160
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "=Success!\n\nYou are good to go {{ $('Webhook').item.json.body.name }}. We have sent you a welcome email. Good  Luck! If you can't see it, please check your spam folder and mark it as not spam."
      },
      "typeVersion": 1.2
    },
    {
      "id": "59497004-29f0-4ef5-9cc6-5b5ff43b8cf5",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        -420
      ],
      "parameters": {
        "width": 1920,
        "height": 900,
        "content": "## 使用bolt.new前端管理订阅"
      },
      "typeVersion": 1
    },
    {
      "id": "0de46767-048c-4c0f-972a-6e14e05921ea",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        960
      ],
      "parameters": {
        "color": 4,
        "width": 2540,
        "height": 560,
        "content": "## 抓取职位信息、格式化新闻通讯并发送给订阅者"
      },
      "typeVersion": 1
    },
    {
      "id": "f0d3506b-8a79-44c7-b2a3-206d32f03749",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -340,
        560
      ],
      "parameters": {
        "color": 3,
        "width": 1700,
        "height": 320,
        "content": "## 管理退订"
      },
      "typeVersion": 1
    },
    {
      "id": "add9d4b3-e004-44ea-8055-a206a3a367f2",
      "name": "Gmail",
      "type": "n8n-nodes-base.gmail",
      "disabled": true,
      "position": [
        2420,
        1200
      ],
      "webhookId": "f94f14d3-bb4b-4162-bac5-7de53c838420",
      "parameters": {
        "sendTo": "={{ $('Get Subscribers').item.json['Email Address'] }}",
        "message": "={{ $json.htmlNewsletter }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "Latest Jobs 4 U"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ckS0CnhtgC3I5ETk",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "3d879853-1a3b-4612-a65d-1f8710a5e3f0",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2340,
        1120
      ],
      "parameters": {
        "color": 5,
        "width": 280,
        "height": 260,
        "content": "## Gmail发送邮件替代方案(新闻通讯)"
      },
      "typeVersion": 1
    },
    {
      "id": "e5c32535-c5e7-44d2-81fb-481108f726bd",
      "name": "停止并报错",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        320,
        1300
      ],
      "parameters": {
        "errorMessage": "No Subscribers Found"
      },
      "typeVersion": 1
    },
    {
      "id": "d6c2a737-5cb9-4ba8-81e6-72d0fb280780",
      "name": "如果有订阅者",
      "type": "n8n-nodes-base.if",
      "position": [
        60,
        1200
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "846d11d1-a02d-4bc8-a316-6bc020874304",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json['Email Address'] }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "ca6c833f-04fe-4979-9221-949e6acc52e7",
      "name": "发送通讯",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2000,
        1180
      ],
      "webhookId": "bfaa8f6c-a5af-482c-ab21-ca7b087cdd17",
      "parameters": {
        "html": "={{ $json.htmlNewsletter }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "Latest Jobs 4 U",
        "toEmail": "={{ $('If there are subscribers').item.json['Email Address'] }}",
        "fromEmail": "\"your-from-email\""
      },
      "credentials": {
        "smtp": {
          "id": "xcnAVXwtuOa1IOqE",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "49e25db4-3183-4afc-ad93-5a681d27ff8b",
      "name": "发送邮件",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1040,
        660
      ],
      "webhookId": "2ddcc7d7-6df2-478a-a3b4-add24024387a",
      "parameters": {
        "html": "=<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Hello {{ $('get row in subscribed sheet').item.json.Name }}, You’ve Been Unsubscribed from Jobs 4 U Newsletter</title>\n    <style>\n      body {\n        font-family: Arial, sans-serif;\n        background-color: #f6f9fc;\n        margin: 0;\n        padding: 0;\n      }\n      .email-container {\n        max-width: 600px;\n        margin: 40px auto;\n        background-color: #ffffff;\n        border-radius: 8px;\n        overflow: hidden;\n        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);\n      }\n      .header {\n        background-color: #1a73e8;\n        color: #ffffff;\n        padding: 24px;\n        text-align: center;\n      }\n      .header h1 {\n        margin: 0;\n        font-size: 24px;\n      }\n      .content {\n        padding: 32px;\n        color: #333333;\n        font-size: 16px;\n        line-height: 1.6;\n      }\n      .content p {\n        margin: 0 0 16px;\n      }\n      .footer {\n        font-size: 12px;\n        color: #888888;\n        text-align: center;\n        padding: 24px;\n        background-color: #f1f1f1;\n      }\n      .footer a {\n        color: #888888;\n        text-decoration: none;\n        margin: 0 8px;\n      }\n    </style>\n  </head>\n  <body>\n    <div class=\"email-container\">\n      <div class=\"header\">\n        <h1>Jobs 4 U</h1>\n      </div>\n      <div class=\"content\">\n        <p>Hi there,</p>\n        <p>\n          You've been successfully unsubscribed from the <strong>Jobs 4 U</strong> newsletter. We're sorry to see you go.\n        </p>\n        <p>\n          If this was a mistake, you're always welcome to subscribe again anytime to get the latest software engineering jobs right in your inbox.\n        </p>\n        <p>Wishing you all the best in your career journey!</p>\n        <p>— The Jobs 4 U Team</p>\n      </div>\n      <div class=\"footer\">\n        <p>\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/terms\">Terms & Conditions</a> |\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/privacy\">Privacy Policy</a>\n        </p>\n        <p>&copy; 2025 Jobs 4 U. All rights reserved.</p>\n      </div>\n    </div>\n  </body>\n</html>\n",
        "options": {},
        "subject": "You have unsubscribed from Jobs 4 U",
        "toEmail": "={{ $('add to unsubscribed sheet').item.json['Email Address'] }}",
        "fromEmail": "\"your-from-email\""
      },
      "credentials": {
        "smtp": {
          "id": "xcnAVXwtuOa1IOqE",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "cc9f78ed-8de0-436c-a164-a0b151517f13",
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmail",
      "disabled": true,
      "position": [
        1540,
        680
      ],
      "webhookId": "f94f14d3-bb4b-4162-bac5-7de53c838420",
      "parameters": {
        "sendTo": "={{ $('add to unsubscribed sheet').item.json['Email Address'] }}",
        "message": "=<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"UTF-8\" />\n    <title>Hello {{ $('get row in subscribed sheet').item.json.Name }}, You’ve Been Unsubscribed from Jobs 4 U Newsletter</title>\n    <style>\n      body {\n        font-family: Arial, sans-serif;\n        background-color: #f6f9fc;\n        margin: 0;\n        padding: 0;\n      }\n      .email-container {\n        max-width: 600px;\n        margin: 40px auto;\n        background-color: #ffffff;\n        border-radius: 8px;\n        overflow: hidden;\n        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);\n      }\n      .header {\n        background-color: #1a73e8;\n        color: #ffffff;\n        padding: 24px;\n        text-align: center;\n      }\n      .header h1 {\n        margin: 0;\n        font-size: 24px;\n      }\n      .content {\n        padding: 32px;\n        color: #333333;\n        font-size: 16px;\n        line-height: 1.6;\n      }\n      .content p {\n        margin: 0 0 16px;\n      }\n      .footer {\n        font-size: 12px;\n        color: #888888;\n        text-align: center;\n        padding: 24px;\n        background-color: #f1f1f1;\n      }\n      .footer a {\n        color: #888888;\n        text-decoration: none;\n        margin: 0 8px;\n      }\n    </style>\n  </head>\n  <body>\n    <div class=\"email-container\">\n      <div class=\"header\">\n        <h1>Jobs 4 U</h1>\n      </div>\n      <div class=\"content\">\n        <p>Hi there,</p>\n        <p>\n          You've been successfully unsubscribed from the <strong>Jobs 4 U</strong> newsletter. We're sorry to see you go.\n        </p>\n        <p>\n          If this was a mistake, you're always welcome to subscribe again anytime to get the latest software engineering jobs right in your inbox.\n        </p>\n        <p>Wishing you all the best in your career journey!</p>\n        <p>— The Jobs 4 U Team</p>\n      </div>\n      <div class=\"footer\">\n        <p>\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/terms\">Terms & Conditions</a> |\n          <a href=\"https://magnificent-tanuki-11356e.netlify.app/privacy\">Privacy Policy</a>\n        </p>\n        <p>&copy; 2025 Jobs 4 U. All rights reserved.</p>\n      </div>\n    </div>\n  </body>\n</html>\n",
        "options": {
          "appendAttribution": false
        },
        "subject": "You have unsubscribed from Jobs 4 U"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ckS0CnhtgC3I5ETk",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "22152918-e32b-40c0-8924-c4f4f854b290",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1460,
        600
      ],
      "parameters": {
        "color": 5,
        "width": 280,
        "height": 260,
        "content": "## Gmail发送邮件替代方案(退订)"
      },
      "typeVersion": 1
    },
    {
      "id": "ed07df99-2c29-4229-a094-83eae1d77965",
      "name": "Gmail2",
      "type": "n8n-nodes-base.gmail",
      "disabled": true,
      "position": [
        1780,
        -240
      ],
      "webhookId": "f94f14d3-bb4b-4162-bac5-7de53c838420",
      "parameters": {
        "sendTo": "={{ $('Webhook').item.json.body.email }}",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>You're Already Subscribed</title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      background-color: #f4f7fa;\n      margin: 0;\n      padding: 0;\n    }\n    .container {\n      max-width: 600px;\n      margin: 40px auto;\n      background-color: #ffffff;\n      padding: 40px;\n      border-radius: 10px;\n      box-shadow: 0 10px 30px rgba(0,0,0,0.05);\n    }\n    .header {\n      text-align: center;\n      padding-bottom: 20px;\n    }\n    .header h1 {\n      color: #2d3748;\n      font-size: 22px;\n      margin-bottom: 10px;\n    }\n    .content {\n      font-size: 16px;\n      color: #4a5568;\n      line-height: 1.6;\n    }\n    .footer {\n      margin-top: 40px;\n      font-size: 12px;\n      text-align: center;\n      color: #a0aec0;\n    }\n    .footer a {\n      color: #2b6cb0;\n      text-decoration: none;\n    }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>You're Already Subscribed</h1>\n    </div>\n    <div class=\"content\">\n      <p>Hi there,</p>\n      <p>It looks like someone recently tried to subscribe <strong>your email</strong> to the Jobs 4 U Newsletter.</p>\n      <p>You're already on our list — no further action is needed!</p>\n      <p>If you did not initiate this request, feel free to ignore this email. Your subscription status has not changed.</p>\n      <p>Thank you for staying with us — great opportunities are always heading your way. 🚀</p>\n    </div>\n    <div class=\"footer\">\n      <p>Review our \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app//terms\" target=\"_blank\">Terms & Conditions</a> and \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app//privacy\" target=\"_blank\">Privacy Policy</a>.\n      </p>\n    </div>\n  </div>\n</body>\n</html>\n",
        "options": {
          "appendAttribution": false
        },
        "subject": "Already Subscribed to Jobs 4 U"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ckS0CnhtgC3I5ETk",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "a37b27ce-a796-40b7-8fa0-8ab2fd276b6d",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        -320
      ],
      "parameters": {
        "color": 5,
        "width": 280,
        "height": 260,
        "content": "## Gmail发送邮件替代方案(邮箱已存在)"
      },
      "typeVersion": 1
    },
    {
      "id": "e01f3884-309e-4e04-ad5f-77acd08a42d2",
      "name": "Gmail3",
      "type": "n8n-nodes-base.gmail",
      "disabled": true,
      "position": [
        1780,
        220
      ],
      "webhookId": "f94f14d3-bb4b-4162-bac5-7de53c838420",
      "parameters": {
        "sendTo": "={{ $('Webhook').item.json.body.email }}",
        "message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Welcome to Jobs 4 U Newsletter</title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      background-color: #f4f7fa;\n      margin: 0;\n      padding: 0;\n    }\n    .container {\n      max-width: 600px;\n      margin: 40px auto;\n      background-color: #ffffff;\n      padding: 40px;\n      border-radius: 10px;\n      box-shadow: 0 10px 30px rgba(0,0,0,0.05);\n    }\n    .header {\n      text-align: center;\n      padding-bottom: 20px;\n    }\n    .header h1 {\n      color: #2d3748;\n      font-size: 24px;\n      margin-bottom: 10px;\n    }\n    .content {\n      font-size: 16px;\n      color: #4a5568;\n      line-height: 1.6;\n    }\n    .button {\n      display: inline-block;\n      margin-top: 20px;\n      padding: 12px 24px;\n      background-color: #2b6cb0;\n      color: white;\n      text-decoration: none;\n      border-radius: 6px;\n      font-weight: bold;\n    }\n    .footer {\n      margin-top: 40px;\n      font-size: 12px;\n      text-align: center;\n      color: #a0aec0;\n    }\n    .footer a {\n      color: #2b6cb0;\n      text-decoration: none;\n    }\n  </style>\n</head>\n<body>\n  <div class=\"container\">\n    <div class=\"header\">\n      <h1>Welcome to the Jobs Newsletter!</h1>\n    </div>\n    <div class=\"content\">\n      <p>Hi {{ $('Webhook').item.json.body.name }},</p>\n      <p>Thanks for subscribing to the <strong>Jobs 4 U Newsletter</strong>! 🧑‍💻</p>\n      <p>Each week, you'll receive handpicked job opportunities straight to your inbox — from remote roles to top-tier tech companies looking for talent just like you.</p>\n      <p>Stay tuned and keep an eye on your inbox. We’re excited to help you take the next step in your career!</p>\n      <p>If you ever want to unsubscribe, you can do so at the bottom of any email we send.</p>\n    </div>\n    <div class=\"footer\">\n      <p>By subscribing, you agree to our \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app/terms\" target=\"_blank\">Terms & Conditions</a> and \n        <a href=\"https://magnificent-tanuki-11356e.netlify.app/privacy\" target=\"_blank\">Privacy Policy</a>.\n      </p>\n      <p>Happy job hunting! 🚀</p>\n    </div>\n  </div>\n</body>\n</html>\n",
        "options": {
          "appendAttribution": false
        },
        "subject": "Welcome to Jobs 4 U Newsletter"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "ckS0CnhtgC3I5ETk",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "b4c5f6d4-7fad-45b7-ba78-d95b16bd181e",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1700,
        140
      ],
      "parameters": {
        "color": 5,
        "width": 280,
        "height": 260,
        "content": "## Gmail发送邮件替代方案(欢迎邮件)"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "59aa6d34-959e-4fc3-bd54-f7b2f4c5b075",
  "connections": {
    "If1": {
      "main": [
        [
          {
            "node": "Send Welcome Email",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add Email to All Subscribers Sheet",
            "type": "main",
            "index": 0
          },
          {
            "node": "Add Email to Subscribed Sheet",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notification of Invalid Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Notification of Successful Subscription",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Format Newsletter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Get All Subscribers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Jobs": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook1": {
      "main": [
        [
          {
            "node": "get rows in all subscribers sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Summarize Job Descriprions",
            "type": "main",
            "index": 0
          },
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Send Email1": {
      "main": [
        [
          {
            "node": "Notification of Already Exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Subscribers": {
      "main": [
        [
          {
            "node": "If there are subscribers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Subscribers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Newsletter": {
      "main": [
        [
          {
            "node": "Send Newsletter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Welcome Email": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Subscribers": {
      "main": [
        [
          {
            "node": "If email is already in database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Confirm Email Validity": {
      "main": [
        [
          {
            "node": "If1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If there are subscribers": {
      "main": [
        [
          {
            "node": "Get Jobs",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add to unsubscribed sheet": {
      "main": [
        [
          {
            "node": "get row in subscribed sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Job Descriprions": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "delete row from subscribed": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get row in subscribed sheet": {
      "main": [
        [
          {
            "node": "delete row from subscribed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Email to Subscribed Sheet": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "change status to unsubscribed": {
      "main": [
        [
          {
            "node": "add to unsubscribed sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If email is already in database": {
      "main": [
        [
          {
            "node": "Send Email1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Confirm Email Validity",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get rows in all subscribers sheet": {
      "main": [
        [
          {
            "node": "change status to unsubscribed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Email to All Subscribers Sheet": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

高级 - 人工智能, 营销

需要付费吗?

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

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

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

作者
Joseph

Joseph

@mjomba

Automation expert specializing in building smart, scalable workflows using tools like n8n, Make, and Airtable. I help businesses save time, reduce manual work, and grow faster with tailored automation solutions. Feel free to reach out at joseph@uppfy.com to discuss your project. I am also on x.com/juppfy

外部链接
在 n8n.io 查看

分享此工作流