{
  "name": "Generate & deliver certificates with VerifiEmail & HTMLcsstoImg to Gmail",
  "nodes": [
    {
      "id": "8aef6c7c-9dfd-483b-9b66-ee9a21ad0e3b",
      "name": "Credentials Setup Guide",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3024,
        -96
      ],
      "parameters": {
        "width": 452,
        "height": 856,
        "content": "## 🔧 CREDENTIALS SETUP REQUIRED\n\nBefore activating this workflow, configure these credentials:\n\n1. VerifiEmail API\n   - Sign up at https://verifi.email\n   - Get your API key from dashboard\n   - In n8n"
      }
    },
    {
      "id": "713712a6-27e5-482b-8994-eae001ab2785",
      "name": "Webhook Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2512,
        64
      ],
      "parameters": {
        "width": 444,
        "height": 628,
        "content": "## 📥 WEBHOOK TRIGGER\n\nAccepts POST requests with certificate data\n\nRequired JSON format:\n```\n{\n  \"name\": \"John Doe\",\n  \"course\": \"Course Name\",\n  \"date\": \"2025-10-04\",\n  \"email\": \"user@example.com\"\n}\n"
      }
    },
    {
      "id": "a8b8e036-c01d-4091-b817-43611a1e2643",
      "name": "Certificate Request Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -2192,
        544
      ]
    },
    {
      "id": "3129040e-f390-4661-b17a-32b5c029cd8b",
      "name": "Email Validation Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2016,
        144
      ],
      "parameters": {
        "width": 380,
        "height": 548,
        "content": "## 📧 EMAIL VALIDATION STEP\n\nUses VerifiEmail API to validate recipient email\n\nChecks performed:\n✓ RFC Compliance (proper email format)\n✓ Valid MX Records (domain accepts email)\n✓ Spoof Detection (chec"
      }
    },
    {
      "id": "5c1071ea-cc45-49b2-9498-083d3a09508b",
      "name": "Validation Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1584,
        80
      ],
      "parameters": {
        "width": 360,
        "height": 596,
        "content": "## ✅ VALIDATION CHECKPOINT\n\nChecks ALL required conditions:\n\nFrom Webhook:\n1. Name is not empty\n2. Course is not empty\n3. Date is not empty\n\nFrom VerifiEmail:\n4. Email validation = true\n\nAll condition"
      }
    },
    {
      "id": "745c8af8-c38e-4257-968d-c8abeb30e5d3",
      "name": "Data Combination Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        -32
      ],
      "parameters": {
        "width": 380,
        "height": 716,
        "content": "## 🔄 COMBINE WEBHOOK + EMAIL DATA\n\nMerges certificate data with email validation results\n\nInput sources:\n• Webhook data: name, course, date, email, instructor, duration\n• Email validation: valid, prov"
      }
    },
    {
      "id": "99566da7-4b33-4df0-a280-5a5db861bf13",
      "name": "HTML Generation Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -768,
        -48
      ],
      "parameters": {
        "width": 380,
        "height": 724,
        "content": "## 🎨 HTML CERTIFICATE GENERATOR\n\nCreates beautiful HTML certificate with:\n\nDesign Features:\n• Purple gradient background (#667eea → #764ba2)\n• Professional typography (Playfair Display + Montserrat)\n•"
      }
    },
    {
      "id": "d2f582b7-9d23-43b9-bc05-e50f96ad122f",
      "name": "Generate HTML Certificate",
      "type": "n8n-nodes-base.code",
      "position": [
        -640,
        528
      ]
    },
    {
      "id": "9e764afe-be0f-4a6a-b5fc-4e2213353ae4",
      "name": "Image Conversion Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -16
      ],
      "parameters": {
        "width": 380,
        "height": 704,
        "content": "## IMAGE CONVERSION\n\nConverts HTML certificate to high-quality PNG image\n\nService: HTMLcsstoImg API\nAPI Endpoint: hcti.io\n\nConfiguration:\n• Input: {{ $json.html }}\n• Google Fonts: Playfair Display|Mon"
      }
    },
    {
      "id": "edac6e11-432b-42f2-9128-b39d4585bd5b",
      "name": "Email Delivery Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        -128
      ],
      "parameters": {
        "width": 380,
        "height": 808,
        "content": "## CERTIFICATE EMAIL DELIVERY\n\nSends professional congratulatory email via Gmail\n\nEmail Contents:\n• Subject: \"🎓 Congratulations! Your Certificate of Completion\"\n• HTML-formatted message with:\n  - Grad"
      }
    },
    {
      "id": "7acdd47b-7014-4e0f-8b44-5acf326412be",
      "name": "Send Certificate Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        288,
        528
      ]
    },
    {
      "id": "5820e8bb-2f26-4d04-8445-61ea99902d35",
      "name": "Database Logging Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        -176
      ],
      "parameters": {
        "width": 380,
        "height": 864,
        "content": "## GOOGLE SHEETS LOGGING\n\nRecords every certificate to spreadsheet for tracking\n\nSpreadsheet: \"Certificates Log\"\nSheet: Sheet1\n\nLogged Data (10 columns):\n1. Certificate ID - Unique identifier\n2. Recip"
      }
    },
    {
      "id": "37b407ee-9362-402a-b708-5c821e1e1116",
      "name": "Log to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        752,
        528
      ]
    },
    {
      "id": "559bc397-1e64-4f9e-91e0-69f01a2de564",
      "name": "Success Response Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        352
      ],
      "parameters": {
        "width": 716,
        "height": 624,
        "content": "## ⚠️ RECOMMENDED ADDITION\n\nMISSING: Success Response to Webhook\n\nCurrently, workflow completes but doesn't send response back to webhook caller.\n\nTo add:\n1. Add \"Respond to Webhook\" node\n   After \"Lo"
      }
    },
    {
      "id": "bd541a23-e982-4b64-82e2-30aea3e7601d",
      "name": "Error Handling Info",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2032,
        1088
      ],
      "parameters": {
        "width": 472,
        "height": 564,
        "content": "## ⚠️ ERROR HANDLING\n\nWorkflow includes error catching and notification\n\nError Trigger:\n• Catches any workflow errors\n• Activates separate error flow\n\nError Processing:\n1. Format Error Details (Code n"
      }
    },
    {
      "id": "429a6ac5-d269-4176-ac81-d65117df54dd",
      "name": "On Workflow Error",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        -1680,
        1216
      ]
    },
    {
      "id": "e3cc736c-3a91-42d5-9037-5ffcad3e8cab",
      "name": "Format Error Details",
      "type": "n8n-nodes-base.code",
      "position": [
        -1472,
        1216
      ]
    },
    {
      "id": "c1ec5078-2bc7-4f7d-b413-fa0ca7691a15",
      "name": "Send Slack Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        -1280,
        1216
      ]
    },
    {
      "id": "7d756f81-a0ac-4b11-bf07-dded65a5070d",
      "name": "Workflow Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3376,
        800
      ],
      "parameters": {
        "width": 444,
        "height": 760,
        "content": "## COMPLETE WORKFLOW STRUCTURE\n\nMain Certificate Generation Flow:\n\n1. 📥 Webhook Trigger\n   Receives JSON with certificate data\n\n2. 📧 Verifi Email\n   Validates email address with VerifiEmail API\n\n3. ✅ "
      }
    },
    {
      "id": "7c4dc0c1-ae2b-4985-91de-a40356e28158",
      "name": "Testing Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2896,
        832
      ],
      "parameters": {
        "width": 568,
        "height": 856,
        "content": "## 🧪 TESTING YOUR WORKFLOW\n\nWebhook URL:\nhttps://n8n.exildraw.com/webhook-test/certificate-generator\n\nTest with cURL:\n```\ncurl -X POST https://n8n.exildraw.com/webhook-test/certificate-generator \\\n  -"
      }
    },
    {
      "id": "b9b4ba6f-35ca-4733-9d0a-0e2a7da5b56e",
      "name": "HTML/CSS to Image",
      "type": "n8n-nodes-htmlcsstoimage.htmlCssToImage",
      "position": [
        -160,
        528
      ]
    },
    {
      "id": "de9c267d-d005-43d4-bbb3-c33370f9493a",
      "name": "Verifi Email",
      "type": "n8n-nodes-verifiemail.verifiEmail",
      "position": [
        -1872,
        544
      ]
    },
    {
      "id": "646e0a7b-2cdc-48c0-8f15-5b7755e9e484",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -1392,
        544
      ]
    },
    {
      "id": "9b7e5242-b3da-4552-b088-d585ffe7bcb0",
      "name": "Stop and Error",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        -1040,
        784
      ]
    },
    {
      "id": "b57d3884-9846-4b1f-9b00-ec378ea386ac",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "position": [
        -1056,
        528
      ]
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verifi Email": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTML/CSS to Image": {
      "main": [
        [
          {
            "node": "Send Certificate Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On Workflow Error": {
      "main": [
        [
          {
            "node": "Format Error Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Generate HTML Certificate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Error Details": {
      "main": [
        [
          {
            "node": "Send Slack Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Certificate Email": {
      "main": [
        [
          {
            "node": "Log to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate HTML Certificate": {
      "main": [
        [
          {
            "node": "HTML/CSS to Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Certificate Request Webhook": {
      "main": [
        [
          {
            "node": "Verifi Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}