8
n8n 한국어amn8n.com

AI 생성 이메일 소통

중급

이것은AI, Marketing분야의자동화 워크플로우로, 8개의 노드를 포함합니다.주로 Set, Code, Gmail, Agent, ScheduleTrigger 등의 노드를 사용하며인공지능 기술을 결합하여 스마트 자동화를 구현합니다. GPT와 Gmail을 사용하여 AI 뉴스 레터 자동 생성 및 전송

사전 요구사항
  • Google 계정 및 Gmail API 인증 정보
  • OpenAI API Key
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "id": "DSxmKG8H861zKUw8",
  "meta": {
    "instanceId": "18c9b77a7db94bab09d77f4a9c44dd94853695bba1618cb7bc3c4bc412c07c1e",
    "templateCredsSetupCompleted": true
  },
  "name": "AI Generated Email Newsletter",
  "tags": [],
  "nodes": [
    {
      "id": "a915b64b-1052-4cd1-aca9-0325c1b2c29d",
      "name": "워크플로우 문서",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -140
      ],
      "parameters": {
        "color": 6,
        "width": 450,
        "height": 420,
        "content": "## Daily AI News Summary Workflow\n\nThis workflow runs every day at 9 AM to:\n\n1. **Fetch Latest AI News**: Uses Perplexity to find recent AI developments\n2. **Categorize Content**: Organizes news into three key areas:\n   - 🚀 New Technology (breakthroughs, models, research)\n   - 💡 Tips & Tricks (practical applications, tutorials)\n   - 🛡️ AI Ethics & Security (privacy, safety, regulations)\n3. **Format & Send**: Creates a beautiful HTML email with summaries and links\n\n### Setup Required:\n- Perplexity API credentials\n- SMTP email credentials\n- Update recipient email address\n\n### Customization:\n- Change schedule time in Daily Trigger\n- Modify categories in Perplexity prompt\n- Adjust email styling in Format Email Content node"
      },
      "typeVersion": 1
    },
    {
      "id": "3c6ef52a-3c4b-4d0e-be08-d496c407fa66",
      "name": "설정 안내",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        0
      ],
      "parameters": {
        "color": 3,
        "width": 580,
        "height": 280,
        "content": "⚙️ **Configuration Needed:**\n\n1. **AI Agent**: Add your Chat Model API key to the \"AI Agent\"\n\n2. **Email Settings**: \n   - Add your Gmail Credentials\n   - Add subject and message seperately\n   - Email should be in HTML format\n\n3. **Timing**: Modify schedule in \"Daily Trigger\" if you want different timing\n\n4. **Content**: Customize the news categories or add more in the AI Agent prompt"
      },
      "typeVersion": 1
    },
    {
      "id": "2f165ff5-7666-4f7b-93e0-73556ad9ed7a",
      "name": "날짜 설정1",
      "type": "n8n-nodes-base.set",
      "position": [
        60,
        360
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "current-date",
              "name": "currentDate",
              "type": "string",
              "value": "={{ $now.format('yyyy-MM-dd') }}"
            },
            {
              "id": "yesterday-date",
              "name": "lastweekDate",
              "type": "string",
              "value": "={{ $now.minus({days: 7}).format('yyyy-MM-dd') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "419a0eac-33f1-4349-ba54-a0a428ef8c1b",
      "name": "Gmail1",
      "type": "n8n-nodes-base.gmail",
      "position": [
        880,
        360
      ],
      "webhookId": "6e5776e8-b6b9-4c56-8b3a-812f68959433",
      "parameters": {
        "sendTo": "jyothi.swarup@techdome.net.in",
        "message": "={{ $json.html }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "kqndcZ7sNbQqDrJF",
          "name": "Gmail account"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "57cb8666-b3ff-489b-a6a5-be329ad82ab5",
      "name": "이메일 내용 포맷팅",
      "type": "n8n-nodes-base.code",
      "position": [
        660,
        360
      ],
      "parameters": {
        "jsCode": "// n8n Code Node - Email Formatter for AI Newsletter\n// This code formats the AI agent output for email sending\n\n// Get the AI agent output from the previous node\nconst aiOutput = $input.all()[0].json.output || $input.all()[0].json.text || $input.all()[0].json;\n\n// Extract the newsletter content (remove the prefix text)\nlet newsletterContent = '';\nif (typeof aiOutput === 'object' && aiOutput.content) {\n  newsletterContent = aiOutput.content;\n} else if (typeof aiOutput === 'string') {\n  // Remove the \"this is the output from the ai agent:\" prefix if it exists\n  newsletterContent = aiOutput.replace(/^this is the output from the ai agent:\\s*/i, '');\n} else {\n  newsletterContent = JSON.stringify(aiOutput);\n}\n\n// Clean up the newsletter content - remove \\n literals and format properly\nnewsletterContent = newsletterContent\n  .replace(/\\\\n/g, '\\n')  // Convert literal \\n to actual newlines\n  .replace(/^\\s+|\\s+$/g, '')  // Trim whitespace\n  .replace(/\\n{3,}/g, '\\n\\n');  // Replace multiple newlines with double newlines\n\n// Generate email subject with current date\nfunction generateEmailSubject() {\n  const currentDate = new Date().toLocaleDateString('en-US', { \n    year: 'numeric', \n    month: 'long', \n    day: 'numeric' \n  });\n  return `🤖 AI Weekly Pulse - ${currentDate}: ChatGPT Voice Update & Latest AI News`;\n}\n\n// Generate email body with proper formatting\nfunction generateEmailBody() {\n  const emailBody = `Hi there!\n\nI hope this email finds you well. Here's this week's AI newsletter with the latest updates from the AI world:\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n${newsletterContent}\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\nHope you found this week's AI updates valuable! Feel free to reply with your thoughts or questions.\n\nBest regards,\nAI Weekly Pulse Team\n\n---\n📧 This newsletter was automatically generated and sent via n8n automation.\n🔗 Want to unsubscribe or have questions? Just reply to this email.`;\n\n  return emailBody;\n}\n\n// Generate HTML version of the email for better formatting\nfunction generateHTMLEmailBody() {\n  // Convert markdown-like content to basic HTML\n  let htmlContent = newsletterContent\n    .replace(/^# (.*$)/gm, '<h1 style=\"color: #333; border-bottom: 2px solid #667eea; padding-bottom: 10px;\">$1</h1>')\n    .replace(/^## (.*$)/gm, '<h2 style=\"color: #444; margin-top: 30px; margin-bottom: 15px;\">$1</h2>')\n    .replace(/^### (.*$)/gm, '<h3 style=\"color: #555; margin-top: 20px; margin-bottom: 10px;\">$1</h3>')\n    .replace(/\\*\\*(.*?)\\*\\*/g, '<strong>$1</strong>')\n    .replace(/\\*(.*?)\\*/g, '<em>$1</em>')\n    .replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g, '<a href=\"$2\" style=\"color: #667eea; text-decoration: none;\">$1</a>')\n    .replace(/^- (.*$)/gm, '<li style=\"margin-bottom: 8px;\">$1</li>')\n    .replace(/^> (.*$)/gm, '<blockquote style=\"border-left: 4px solid #667eea; padding-left: 20px; margin: 20px 0; font-style: italic; color: #666;\">$1</blockquote>')\n    .replace(/---/g, '<hr style=\"border: none; border-top: 2px solid #eee; margin: 30px 0;\">')\n    .replace(/\\n\\n/g, '</p><p style=\"line-height: 1.6; margin-bottom: 15px;\">')\n    .replace(/\\n/g, '<br>');\n\n  // Wrap list items in ul tags\n  htmlContent = htmlContent.replace(/(<li[^>]*>.*?<\\/li>)/gs, '<ul style=\"padding-left: 20px; margin-bottom: 20px;\">$1</ul>');\n\n  const htmlBody = `\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    <title>AI Weekly Pulse</title>\n</head>\n<body style=\"font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; background-color: #f9f9f9;\">\n    <div style=\"background: white; padding: 40px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);\">\n        <div style=\"text-align: center; margin-bottom: 30px; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 8px; color: white;\">\n            <h1 style=\"margin: 0; font-size: 24px;\">🤖 AI Weekly Pulse</h1>\n            <p style=\"margin: 10px 0 0 0; opacity: 0.9;\">Your Weekly Dose of AI Innovation</p>\n        </div>\n        \n        <div style=\"margin-bottom: 30px;\">\n            <p style=\"font-size: 16px; color: #555;\">Hi there!</p>\n            <p style=\"font-size: 16px; color: #555;\">Hope this email finds you well. Here's this week's AI newsletter with the latest updates from the AI world:</p>\n        </div>\n        \n        <div style=\"background: #fafafa; padding: 30px; border-radius: 8px; margin: 20px 0;\">\n            <p style=\"line-height: 1.6; margin-bottom: 15px;\">${htmlContent}</p>\n        </div>\n        \n        <div style=\"margin-top: 40px; padding: 30px; background: #f0f4ff; border-radius: 8px; text-align: center;\">\n            <p style=\"font-size: 16px; color: #555; margin-bottom: 15px;\">Hope you found this week's AI updates valuable!</p>\n            <p style=\"font-size: 16px; color: #555; margin-bottom: 20px;\">Feel free to reply with your thoughts or questions.</p>\n            <p style=\"font-size: 18px; color: #333; margin: 0;\"><strong>Best regards,<br>AI Weekly Pulse Team</strong></p>\n        </div>\n        \n        <div style=\"margin-top: 30px; padding: 20px; background: #e8f2ff; border-radius: 8px; font-size: 14px; color: #666; text-align: center;\">\n            <p style=\"margin: 5px 0;\">📧 This newsletter was automatically generated and sent via n8n automation.</p>\n            <p style=\"margin: 5px 0;\">🔗 Want to unsubscribe or have questions? Just reply to this email.</p>\n        </div>\n    </div>\n</body>\n</html>`;\n\n  return htmlBody;\n}\n\n// Generate the formatted output for the email node\nconst emailSubject = generateEmailSubject();\nconst emailBodyText = generateEmailBody();\nconst emailBodyHTML = generateHTMLEmailBody();\n\n// Return the formatted data for the next node (email sender)\nreturn [\n  {\n    json: {\n      subject: emailSubject,\n      text: emailBodyText,\n      html: emailBodyHTML,\n      // Additional metadata\n      newsletter_content: newsletterContent,\n      generated_at: new Date().toISOString(),\n      email_type: \"ai_weekly_pulse\"\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "9a9676bb-d645-49fc-84ab-5a5c0cd92645",
      "name": "AI 에이전트",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        280,
        360
      ],
      "parameters": {
        "text": "=Newsletter Structure\n1. Title\nEngaging and punchy (under 10 words).\n\nIncludes a relevant keyword (e.g., “AI”, “ChatGPT”, “Machine Learning”).\n\n2. Editor’s Note (Optional but preferred)\nA short 2–3 sentence personal note to the readers.\n\nTone: Conversational and warm.\n\nSummarize the theme of this issue or highlight an AI trend to watch.\n\n3. 🧠 AI in Focus (Main Story)\nOne key development or trend in AI this week.\n\nCould be about a breakthrough, a major product launch, a regulatory move, or a case study.\n\n3–5 paragraphs long.\n\nInclude context (why it matters), impact, and your analysis.\n\n4. 📰 Headlines in AI (News Roundup)\nList 3–5 bite-sized headlines with 1–2 sentence summaries for each. Include:\n\nDate (optional).\n\nSource (e.g., OpenAI, Google, MIT, etc.).\n\nLink (if available).\n\nExample:\n\nOpenAI Releases GPT-5 Preview – OpenAI teased major upgrades in language understanding and reasoning. Read more\n\n5. 🔍 Tool of the Week\nIntroduce one new or underrated AI tool.\n\nInclude what it does, who it’s for, and how it works (2–3 sentences).\n\nInclude a link if available.\n\n6. 📚 Learning Corner\nRecommend one AI resource: a blog post, YouTube video, podcast, free course, or paper.\n\nMention why it’s worth reading/listening/watching.\n\n7. 🤖 Prompt of the Week\nShare a powerful or creative prompt users can try with ChatGPT or any LLM.\n\nExplain what it does and when to use it.\n\n8. 📈 AI Stat of the Week\nShare one interesting stat about AI.\n\nCite the source and explain the takeaway in 1–2 sentences.\n\n9. 👥 Community Shoutout (Optional)\nHighlight a person, open-source project, or discussion in the AI community.\n\n10. 👀 What to Watch Next Week\nPreview an upcoming event, release, or expected trend in AI.\n\nKeep it short (1–2 sentences).\n\n🧾 Style Guidelines\nUse markdown for formatting: **bold**, # headers, - lists, etc.\n\nKeep tone informative, clear, and slightly casual.\n\nAvoid jargon unless explained.\n\nUse bullet points and subheaders for readability.\n\nProvide citations for all the topics immediately ",
        "options": {
          "systemMessage": "You are an AI writing assistant tasked with creating a weekly newsletter about artificial intelligence (AI). The goal is to inform, engage, and educate readers ranging from tech-savvy professionals to curious enthusiasts. Follow the structure below and ensure the tone is professional yet accessible."
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "4e5e19a9-b05f-4ef0-a432-a0e72c479095",
      "name": "Azure OpenAI 채팅 모델",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        260,
        520
      ],
      "parameters": {
        "model": "gpt-4.1",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "id": "gDiLXmZSX0q3CyLu",
          "name": "Azure Open AI account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e7dbd62a-6580-4a28-ab85-5fdf885dacf0",
      "name": "일정 트리거",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -140,
        360
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e0cf8d41-3776-4aab-a5ec-fd16b8bc7457",
  "connections": {
    "9a9676bb-d645-49fc-84ab-5a5c0cd92645": {
      "main": [
        [
          {
            "node": "57cb8666-b3ff-489b-a6a5-be329ad82ab5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2f165ff5-7666-4f7b-93e0-73556ad9ed7a": {
      "main": [
        [
          {
            "node": "9a9676bb-d645-49fc-84ab-5a5c0cd92645",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "e7dbd62a-6580-4a28-ab85-5fdf885dacf0": {
      "main": [
        [
          {
            "node": "2f165ff5-7666-4f7b-93e0-73556ad9ed7a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "57cb8666-b3ff-489b-a6a5-be329ad82ab5": {
      "main": [
        [
          {
            "node": "419a0eac-33f1-4349-ba54-a0a428ef8c1b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4e5e19a9-b05f-4ef0-a432-a0e72c479095": {
      "ai_languageModel": [
        [
          {
            "node": "9a9676bb-d645-49fc-84ab-5a5c0cd92645",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - 인공지능, 마케팅

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수8
카테고리2
노드 유형7
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
Rahul Joshi

Rahul Joshi

@rahul08

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34