{
  "name": "[공무원] 추가자료 수강생 행사 공지 메일",
  "nodes": [
    {
      "parameters": {
        "formTitle": "행사 공지 보내기",
        "formDescription": "입력한 내용이 수강생 리스트의 모든 분께 메일로 발송됩니다.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "제목",
              "fieldType": "text",
              "placeholder": "예: n8n 업무 자동화 설명회",
              "requiredField": true
            },
            {
              "fieldLabel": "일시",
              "fieldType": "text",
              "placeholder": "예: 12월 10일(수) 14시, 본관 3층 대회의실",
              "requiredField": true
            },
            {
              "fieldLabel": "내용",
              "fieldType": "textarea",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.5,
      "position": [
        0,
        0
      ],
      "webhookId": "b4f8a2c1-6e3d-4a9b-8c7e-2f1d3a4b5c62",
      "id": "d1x-notice-form",
      "name": "공지 입력 폼"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": "여기에_본인_시트_ID"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "수강생 리스트"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.7,
      "position": [
        220,
        0
      ],
      "id": "d1x-sheets-read",
      "name": "수강생 리스트 불러오기"
    },
    {
      "parameters": {
        "batchSize": 1,
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        440,
        0
      ],
      "id": "d1x-loop",
      "name": "수강생마다 반복"
    },
    {
      "parameters": {
        "sendTo": "={{ $json.이메일 }}",
        "subject": "=[행사 안내] {{ $('공지 입력 폼').first().json.제목 }}",
        "emailType": "html",
        "message": "=<div style=\"font-family: 'Malgun Gothic', sans-serif; max-width: 600px; margin: 0 auto; border: 1px solid #dddddd; border-radius: 8px; overflow: hidden;\">\n  <div style=\"background: #ea4b71; color: #ffffff; padding: 20px 24px; font-size: 20px; font-weight: bold;\">{{ $('공지 입력 폼').first().json.제목 }}</div>\n  <div style=\"padding: 24px; color: #333333; font-size: 15px; line-height: 1.7;\">\n    <p>{{ $json.이름.replace(/[<>]/g, '') }}님({{ $json.소속.replace(/[<>]/g, '') }}), 안녕하세요.</p>\n    <p style=\"background: #f5f5f5; padding: 12px 16px; border-radius: 6px;\"><b>일시</b> {{ $('공지 입력 폼').first().json.일시 }}</p>\n    <p>{{ $('공지 입력 폼').first().json.내용.replace(/\\n/g, '<br>') }}</p>\n    <p>감사합니다.</p>\n  </div>\n</div>",
        "options": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.2,
      "position": [
        680,
        120
      ],
      "id": "d1x-gmail-notice",
      "name": "공지 메일 보내기"
    }
  ],
  "connections": {
    "공지 입력 폼": {
      "main": [
        [
          {
            "node": "수강생 리스트 불러오기",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "수강생 리스트 불러오기": {
      "main": [
        [
          {
            "node": "수강생마다 반복",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "수강생마다 반복": {
      "main": [
        [],
        [
          {
            "node": "공지 메일 보내기",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "공지 메일 보내기": {
      "main": [
        [
          {
            "node": "수강생마다 반복",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}
