8
n8n 中文网amn8n.com

着陆页 -> NDA Word文档(Docx) -> 电子邮件

中级

这是一个自动化工作流,包含 10 个节点。主要使用 Set, Html, Webhook, EmailSend, RespondToWebhook 等节点。 从网页表单提交生成并邮件发送定制NDA文档

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)

分类

-
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "kKj0sdENnEH9DPqg",
  "meta": {
    "instanceId": "b503899dfd9ae32bbf8e1f446a1f2c9b3c59f80c79b274c49b1606b7ae9579e1",
    "templateCredsSetupCompleted": true
  },
  "name": "着陆页 -> NDA Word 文档 (Docx) -> 电子邮件",
  "tags": [],
  "nodes": [
    {
      "id": "4b6806d1-ef93-4132-9236-ac1a3e15f91d",
      "name": "发送邮件",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        -112,
        -48
      ],
      "webhookId": "5a491616-916d-41a0-a7bb-8e21dcfc33b2",
      "parameters": {
        "text": "Hello,\n\nHere is the requested NDA form.\n\nBest\nHenrik",
        "options": {
          "attachments": "data"
        },
        "subject": "NDA",
        "toEmail": "test@testmail.com",
        "fromEmail": "test@test.de",
        "emailFormat": "text"
      },
      "credentials": {
        "smtp": {
          "id": "vvY03KbEvsdTVMXI",
          "name": "SMTP account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "4f0d8d76-8d96-470e-b30f-ec7bfc140517",
      "name": "表单数据端点",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -896,
        -48
      ],
      "webhookId": "e79fe93f-4909-4d1e-89fd-ec744edfd5e9",
      "parameters": {
        "path": "2f94bacb-f629-4053-a204-cab2ac8fd326",
        "options": {
          "responseData": "<h1>Hello World</h1>"
        },
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "92960779-4b49-47a1-b934-000a64f922b6",
      "name": "着陆页的 HTML",
      "type": "n8n-nodes-base.html",
      "position": [
        -352,
        -448
      ],
      "parameters": {
        "html": "<!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>Request a NDA</title>\n  <script src=\"https://cdn.tailwindcss.com\"></script>\n</head>\n<body class=\"bg-gray-50 min-h-screen flex flex-col items-center justify-center p-6\">\n\n  <div class=\"w-full max-w-md bg-white shadow-xl rounded-2xl p-8\">\n    <h1 class=\"text-2xl font-semibold text-gray-800 mb-4 text-center\">\n      Request a NDA\n    </h1>\n    <p class=\"text-gray-500 text-center mb-6\">\n      Fill in your personal details to receive your NDA.\n    </p>\n\n    <!-- Success Message -->\n    <div id=\"success-message\" class=\"hidden bg-green-50 border border-green-200 text-green-700 p-4 rounded-xl text-center mb-4\">\n      ✅ Your request has been successfully submitted!\n    </div>\n\n    <!-- Error Message -->\n    <div id=\"error-message\" class=\"hidden bg-red-50 border border-red-200 text-red-700 p-4 rounded-xl text-center mb-4\">\n      ❌ Something went wrong. Please try again.\n    </div>\n\n    <!-- Form -->\n    <form id=\"quote-form\" class=\"space-y-4\">\n      <div>\n        <label class=\"block text-gray-700 font-medium mb-1\">First Name</label>\n        <input\n          type=\"text\"\n          name=\"firstName\"\n          required\n          class=\"w-full border border-gray-300 rounded-xl px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n        />\n      </div>\n\n      <div>\n        <label class=\"block text-gray-700 font-medium mb-1\">Last Name</label>\n        <input\n          type=\"text\"\n          name=\"lastName\"\n          required\n          class=\"w-full border border-gray-300 rounded-xl px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n        />\n      </div>\n\n      <div>\n        <label class=\"block text-gray-700 font-medium mb-1\">Address</label>\n        <input\n          type=\"text\"\n          name=\"address\"\n          required\n          class=\"w-full border border-gray-300 rounded-xl px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n        />\n      </div>\n\n      <div>\n        <label class=\"block text-gray-700 font-medium mb-1\">House No.</label>\n        <input\n          type=\"text\"\n          name=\"houseNo\"\n          required\n          class=\"w-full border border-gray-300 rounded-xl px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n        />\n      </div>\n\n      <div>\n        <label class=\"block text-gray-700 font-medium mb-1\">Postal Code</label>\n        <input\n          type=\"text\"\n          name=\"postalCode\"\n          required\n          class=\"w-full border border-gray-300 rounded-xl px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n        />\n      </div>\n\n      <div>\n        <label class=\"block text-gray-700 font-medium mb-1\">City</label>\n        <input\n          type=\"text\"\n          name=\"city\"\n          required\n          class=\"w-full border border-gray-300 rounded-xl px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n        />\n      </div>\n\n      <div>\n        <label class=\"block text-gray-700 font-medium mb-1\">Country</label>\n        <input\n          type=\"text\"\n          name=\"country\"\n          required\n          class=\"w-full border border-gray-300 rounded-xl px-4 py-2 focus:ring-2 focus:ring-blue-500 focus:outline-none\"\n        />\n      </div>\n\n      <button\n        type=\"submit\"\n        id=\"submit-btn\"\n        class=\"w-full bg-blue-600 text-white py-3 rounded-xl hover:bg-blue-700 transition-all\"\n      >\n        Submit Request\n      </button>\n    </form>\n  </div>\n\n  <footer class=\"mt-6 text-gray-400 text-sm\">\n    © <span id=\"year\"></span> SecureQuote Insurance Co.\n  </footer>\n\n  <script>\n    document.getElementById('year').textContent = new Date().getFullYear();\n\n    const form = document.getElementById('quote-form');\n    const successMsg = document.getElementById('success-message');\n    const errorMsg = document.getElementById('error-message');\n    const submitBtn = document.getElementById('submit-btn');\n\n    form.addEventListener('submit', async function (e) {\n      e.preventDefault();\n      successMsg.classList.add('hidden');\n      errorMsg.classList.add('hidden');\n      submitBtn.disabled = true;\n      submitBtn.textContent = \"Submitting...\";\n\n      const formData = {\n        firstName: form.firstName.value,\n        lastName: form.lastName.value,\n        address: form.address.value,\n        houseNo: form.houseNo.value,\n        postalCode: form.postalCode.value,\n        city: form.city.value,\n        country: form.country.value,\n      };\n\n      try {\n        const response = await fetch(\"{{ $json.FormEndpoint }}\", {\n          method: \"POST\",\n          headers: { \"Content-Type\": \"application/json\" },\n          body: JSON.stringify(formData),\n        });\n\n        if (response.ok) {\n          form.reset();\n          successMsg.classList.remove('hidden');\n        } else {\n          throw new Error(\"Response not OK\");\n        }\n      } catch (err) {\n        console.error(\"Form submit error:\", err);\n        errorMsg.classList.remove('hidden');\n      }\n\n      submitBtn.disabled = false;\n      submitBtn.textContent = \"Submit Request\";\n    });\n  </script>\n</body>\n</html>\n"
      },
      "typeVersion": 1.2
    },
    {
      "id": "dc09be11-d81d-44ce-98fe-3d4c047a5e11",
      "name": "着陆页端点",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -880,
        -448
      ],
      "webhookId": "2f94bacb-f629-4053-a204-cab2ac8fd326",
      "parameters": {
        "path": "2f94bacb-f629-4053-a204-cab2ac8fd326",
        "options": {},
        "responseMode": "responseNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "529ff102-0807-4d68-9f6b-1ebe2b1d3758",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        -112,
        -448
      ],
      "parameters": {
        "options": {},
        "respondWith": "text",
        "responseBody": "={{ $json.html }}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "5540ef36-3fb0-41a4-bed8-d65a5e7d36f1",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        -560
      ],
      "parameters": {
        "width": 1024,
        "height": 320,
        "content": "## 着陆页服务器"
      },
      "typeVersion": 1
    },
    {
      "id": "cbdf6a73-557f-4037-8752-61a66bc06f2d",
      "name": "设置表单端点",
      "type": "n8n-nodes-base.set",
      "position": [
        -624,
        -448
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "509804fc-dbfa-472d-87d3-1f683e146856",
              "name": "FormEndpoint",
              "type": "string",
              "value": "={{ $json.webhookUrl }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "519070ad-6fab-4008-93c9-9fd904d3d92c",
      "name": "HTML 转 Docx",
      "type": "@custom-js/n8n-nodes-pdf-toolkit.Html2Docx",
      "position": [
        -352,
        -48
      ],
      "parameters": {
        "htmlInput": "={{ $json.html }}"
      },
      "credentials": {
        "customJsApi": {
          "id": "BFGbk0a71fKWY967",
          "name": "Coding Service"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "02519104-5034-4e4c-845a-c8a56175aa83",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -944,
        -144
      ],
      "parameters": {
        "width": 1024,
        "height": 320,
        "content": "## 表单数据端点"
      },
      "typeVersion": 1
    },
    {
      "id": "471c6774-3892-4ed3-9703-aff9b05ff2d2",
      "name": "NDA (HTML 版本)",
      "type": "n8n-nodes-base.html",
      "position": [
        -608,
        -48
      ],
      "parameters": {
        "html": "<!DOCTYPE html>\n<html lang=\"de\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Non-Disclosure Agreement</title>\n    <style>\n        body {\n            font-family: 'Times New Roman', Times, serif;\n            font-size: 12pt;\n            line-height: 1.5;\n            color: #000000;\n        }\n        .header p {\n            margin: 0;\n            padding: 0;\n            line-height: 1.4;\n        }\n        h1 {\n            text-align: center;\n            font-size: 16pt;\n            font-weight: bold;\n        }\n        p {\n            margin: 0 0 0.5cm 0;\n        }\n        ul {\n            list-style-type: disc;\n            padding-left: 40px;\n        }\n        .clause-title {\n            font-weight: bold;\n        }\n    </style>\n</head>\n<body>\n    <div>\n        <div class=\"header\" style=\"padding-bottom: 1cm; border-bottom: 1px solid #000; margin-bottom: 2cm;\">\n            <p><b>SecureQuote Insurance Co.</b></p>\n            <p>1234 Main Street, London, United Kingdom</p>\n            <p>Telefon: +44 20 1234 5678 | E-Mail: contact@securequote.com</p>\n        </div>\n\n        <h1>Non-Disclosure Agreement (NDA)</h1>\n\n        <p>This Non-Disclosure Agreement (“Agreement”) is entered into on <b>{{ $json.body.currentDate }}</b> between:</p>\n        <p>\n            <b>{{ $json.body.firstName }} {{ $json.body.lastName }}</b><br>\n            {{ $json.body.address }} {{ $json.body.houseNo }}<br>\n            {{ $json.body.postalCode }} {{ $json.body.city }}<br>\n            {{ $json.body.country }}<br>\n            (hereinafter referred to as “Recipient”)\n        </p>\n        <p>and</p>\n        <p>\n            <b>SecureQuote Insurance Co.</b><br>\n            (hereinafter referred to as “Discloser”)\n        </p>\n        <p>The parties agree as follows:</p>\n\n        <div>\n            <p class=\"clause-title\">1. Definition of Confidential Information</p>\n            <p>“Confidential Information” means all non-public information disclosed by the Discloser to the Recipient, whether in written, oral, electronic, or any other form, including but not limited to business plans, strategies, financial data, customer information, and technical details.</p>\n        </div>\n        <div>\n            <p class=\"clause-title\">2. Obligations of the Recipient</p>\n            <p>The Recipient agrees to:\n                <ul>\n                    <li>Maintain the confidentiality of the Confidential Information;</li>\n                    <li>Not disclose it to any third party without prior written consent from the Discloser;</li>\n                    <li>Use the information solely for the purpose agreed upon by both parties.</li>\n                </ul>\n            </p>\n        </div>\n        <div>\n            <p class=\"clause-title\">3. Exclusions</p>\n            <p>The obligations under this Agreement shall not apply to information that:\n                <ul>\n                    <li>Is or becomes publicly available without breach of this Agreement;</li>\n                    <li>Was lawfully received from a third party without restriction;</li>\n                    <li>Was independently developed without reference to the Confidential Information.</li>\n                </ul>\n            </p>\n        </div>\n        <div>\n            <p class=\"clause-title\">4. Duration</p>\n            <p>This Agreement shall commence on the date above and remain in effect for a period of two (2) years, unless terminated earlier by mutual written consent.</p>\n        </div>\n        <div>\n            <p class=\"clause-title\">5. Return or Destruction</p>\n            <p>Upon termination of this Agreement or upon request, the Recipient shall promptly return or destroy all Confidential Information.</p>\n        </div>\n        <div>\n            <p class=\"clause-title\">6. Governing Law</p>\n            <p>This Agreement shall be governed by and construed in accordance with the laws of England and Wales.</p>\n        </div>\n        \n        <br><br>\n\n        <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n            <tr>\n                <td width=\"50%\" valign=\"top\">\n                    <hr>\n                    <b>{{ $json.body.firstName }} {{ $json.body.lastName }}</b><br>\n                    Recipient\n                </td>\n                <td width=\"50%\" valign=\"top\">\n                    <hr>\n                    <b>SecureQuote Insurance Co.</b><br>\n                    Discloser\n                </td>\n            </tr>\n        </table>\n    </div>\n</body>\n</html>"
      },
      "typeVersion": 1.2
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "380216fa-ff30-4bf5-9fef-55bad9c7775a",
  "connections": {
    "HTML to Docx": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FormData Endpoint": {
      "main": [
        [
          {
            "node": "NDA (HTML Version)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Form Endpoint": {
      "main": [
        [
          {
            "node": "HTML for Landingpage",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NDA (HTML Version)": {
      "main": [
        [
          {
            "node": "HTML to Docx",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML for Landingpage": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Landingpage Endpoint": {
      "main": [
        [
          {
            "node": "Set Form Endpoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级

需要付费吗?

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

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

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

外部链接
在 n8n.io 查看

分享此工作流