{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "1363ffcf-aa23-436a-8c53-0a3fbc096cfa",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -352,
        -32
      ],
      "parameters": {
        "path": "b3d366be-bffc-4d2d-a465-db487976ada0",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "lastNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "36da0cb5-4135-4289-bfd9-2ceb81aea84a",
      "name": "Create a member",
      "type": "n8n-nodes-base.mailchimp",
      "onError": "continueRegularOutput",
      "position": [
        -128,
        -32
      ],
      "parameters": {
        "list": "YOUR_MAILCHIMP_LIST_ID ",
        "email": "={{ $json.body.email }}",
        "status": "subscribed",
        "options": {},
        "mergeFieldsUi": {
          "mergeFieldsValues": [
            {
              "name": "FNAME",
              "value": "={{ $json.body.name }}"
            }
          ]
        }
      },
      "credentials": {
        "mailchimpApi": {
          "name": "<your credential>"
        }
      },
      "retryOnFail": false,
      "typeVersion": 1,
      "alwaysOutputData": false
    },
    {
      "id": "6370189c-3288-4e4a-8c91-cfe831fc96b1",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        96,
        -32
      ],
      "parameters": {
        "sendTo": "={{ $('Webhook').item.json.body.email }}",
        "message": "=<!DOCTYPE html> <html> <body style=\"font-family: Arial, sans-serif; max-width: 600px; margin: 0 auto;\">     <div style=\"background-color: #f8f9fa; padding: 20px; text-align: center;\">         <h1 style=\"color: #333;\">Welcome to [Your Business Name]!</h1>                  <p style=\"font-size: 18px; color: #666;\">             Hi {{ $node[\"Webhook\"].json[\"name\"] || \"there\" }},         </p>                  <p style=\"font-size: 16px; color: #666; line-height: 1.6;\">             Thank you for joining our community! We're excited to have you on board.         </p>                  <div style=\"background-color: #007bff; color: white; padding: 20px; margin: 20px 0; border-radius: 8px;\">             <h2 style=\"margin: 0;\">Your Welcome Gift!</h2>             <p style=\"font-size: 24px; font-weight: bold; margin: 10px 0;\">                 WELCOME15             </p>             <p style=\"margin: 0;\">Use this code for 15% off your first order</p>         </div>                  <a href=\"https://your-website.com/shop\"             style=\"background-color: #28a745; color: white; padding: 15px 30px;                    text-decoration: none; border-radius: 5px; display: inline-block;                    margin: 20px 0;\">             Start Shopping         </a>                  <p style=\"font-size: 14px; color: #999; margin-top: 30px;\">             Follow us on social media for the latest updates and offers!         </p>                  <div style=\"margin-top: 20px;\">             <a href=\"https://facebook.com/yourpage\" style=\"margin: 0 10px;\">Facebook</a>             <a href=\"https://instagram.com/yourpage\" style=\"margin: 0 10px;\">Instagram</a>             <a href=\"https://twitter.com/yourpage\" style=\"margin: 0 10px;\">Twitter</a>         </div>     </div> </body> </html>",
        "options": {},
        "subject": "Welcome to Berley! Here's your 15% discount \ud83c\udf89"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "36131d9d-d138-4955-ae74-40b765851aef",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        -240
      ],
      "parameters": {
        "width": 304,
        "height": 1136,
        "content": "## \ud83d\udce7 Automated Welcome Email with Discount Code\n\n### \ud83c\udfaf What This Does\nAutomatically nurtures new subscribers with personalized welcome emails and discount codes:\n  - **Instant response** to website signup forms via webhook\n  - **Mailchimp integration** adds contacts to your email list\n  - **Branded welcome email** with personalized discount code\n  - **Error handling** ensures emails send even if list addition fails\n\n### \u26a1 How It Works\n  1. Website form submits data to webhook endpoint\n  2. Contact automatically added to Mailchimp audience\n  3. Personalized welcome email sent via Gmail\n  4. Subscriber gets immediate value with discount code\n\n### \ud83d\udee0\ufe0f Setup Required\n**Before using this workflow:**\n  1. Replace YOUR_MAILCHIMP_LIST_ID with your actual Mailchimp list ID\n  2. Update email template with your business name and branding\n  3. Change discount code and shop URL to your own\n  4. Add your website form endpoint to trigger the webhook\n  5. Configure Mailchimp and Gmail credentials\n\n### \ud83d\udca1 Perfect For\n  - E-commerce businesses building customer lists\n  - SaaS companies onboarding trial users\n  - Course creators nurturing leads\n  - Service providers automating client intake"
      },
      "typeVersion": 1
    },
    {
      "id": "244bd91b-1dc0-4b0c-8771-4c7da2ebf0f9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -448,
        -192
      ],
      "parameters": {
        "color": 6,
        "height": 336,
        "content": "#### Step 1: Receive Signup Data\n\nWebhook receives form submissions from your website."
      },
      "typeVersion": 1
    },
    {
      "id": "6768e505-ed3e-4462-8fc3-2825580d9cbc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -192
      ],
      "parameters": {
        "color": 3,
        "height": 336,
        "content": "#### Step 2: Add to Email List\n\nAutomatically adds subscriber to your Mailchimp audience."
      },
      "typeVersion": 1
    },
    {
      "id": "de85be05-732e-4ab9-b12f-5c35dee75a96",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -192
      ],
      "parameters": {
        "color": 4,
        "height": 336,
        "content": "#### Step 3: Send Welcome Email\n\nSends branded welcome email with personalized discount code."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Create a member",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a member": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  }
}