Cartes de codes promotionnels personnalisés pour utilisateurs vérifiés

Avancé

Ceci est unSocial Mediaworkflow d'automatisation du domainecontenant 19 nœuds.Utilise principalement des nœuds comme If, Set, Gmail, Webhook, GoogleSheets. Générer des cartes promotionnelles personnalisées via la vérification d'e-mails, Gmail et Google Sheets

Prérequis
  • Compte Google et informations d'identification Gmail API
  • Point de terminaison HTTP Webhook (généré automatiquement par n8n)
  • Informations d'identification Google Sheets API
Aperçu du workflow
Visualisation des connexions entre les nœuds, avec support du zoom et du déplacement
Exporter le workflow
Copiez la configuration JSON suivante dans n8n pour importer et utiliser ce workflow
{
  "id": "",
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "Personalized Promo Code Cards for Verified Users",
  "tags": [],
  "nodes": [
    {
      "id": "b0df3843-bc98-4a04-b9c5-587df865c8d3",
      "name": "Modifier les champs",
      "type": "n8n-nodes-base.set",
      "position": [
        576,
        816
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "bf99a77f-9879-45b3-b466-1ec73565d9bd",
              "name": "name",
              "type": "string",
              "value": "={{$json.body.name || 'Valued Customer'}}"
            },
            {
              "id": "d5746616-ae00-4394-8c45-b1b2f996b1b0",
              "name": "email",
              "type": "string",
              "value": "={{ $json.body.email }}"
            },
            {
              "id": "78bac585-fbff-4a10-9953-85dbac79b18f",
              "name": "promo_code",
              "type": "string",
              "value": "={{ $json.body.promo_code || 'WELCOME10'}}"
            },
            {
              "id": "f3aae8d3-4d1d-4e3f-8bfc-506321852264",
              "name": "discount_value",
              "type": "string",
              "value": "={{ $json.body.discount_value || '10%' }}"
            },
            {
              "id": "05f0ff79-d917-479d-b7bb-fb9a439fb26c",
              "name": "discount_type",
              "type": "string",
              "value": "={{ $json.body.discount_type || 'percentage' }}"
            },
            {
              "id": "d02a9d89-1474-462c-a9d6-052c9b8aa1fc",
              "name": "timestamp",
              "type": "string",
              "value": "={{new Date().toISOString()}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "af6b8362-eea0-47fa-a524-d8053150504f",
      "name": "Générer l'image de la carte promotionnelle",
      "type": "n8n-nodes-htmlcsstoimage.htmlCssToImage",
      "position": [
        1504,
        688
      ],
      "parameters": {
        "html_content": "=<!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>Promo Card</title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            font-family: 'Arial', sans-serif;\n            background: #f5f5f5;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            min-height: 100vh;\n            padding: 20px;\n        }\n\n        .promo-card {\n            width: 400px;\n            height: 550px;\n            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n            border-radius: 20px;\n            padding: 25px;\n            color: white;\n            text-align: center;\n            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);\n            display: flex;\n            flex-direction: column;\n            justify-content: space-between;\n            overflow: visible;\n        }\n\n        .header {\n            text-align: center;\n        }\n\n        .logo {\n            width: 50px;\n            height: 50px;\n            background: white;\n            border-radius: 50%;\n            margin: 0 auto 15px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            color: #667eea;\n            font-weight: bold;\n            font-size: 18px;\n        }\n\n        .title {\n            font-size: 24px;\n            font-weight: bold;\n            margin-bottom: 10px;\n            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n        }\n\n        .content {\n            flex: 1;\n            display: flex;\n            flex-direction: column;\n            justify-content: center;\n            align-items: center;\n            gap: 8px;\n        }\n\n        .greeting {\n            font-size: 18px;\n            margin-bottom: 5px;\n        }\n\n        .discount-circle {\n            width: 90px;\n            height: 90px;\n            background: rgba(255, 255, 255, 0.2);\n            border: 3px solid rgba(255, 255, 255, 0.4);\n            border-radius: 50%;\n            display: flex;\n            flex-direction: column;\n            justify-content: center;\n            align-items: center;\n            margin: 5px 0;\n            backdrop-filter: blur(10px);\n        }\n\n        .discount-value {\n            font-size: 24px;\n            font-weight: bold;\n            line-height: 1;\n        }\n\n        .discount-text {\n            font-size: 10px;\n            opacity: 0.9;\n        }\n\n        .promo-code {\n            background: rgba(255, 255, 255, 0.2);\n            border: 2px solid rgba(255, 255, 255, 0.3);\n            border-radius: 10px;\n            padding: 8px 16px;\n            font-size: 14px;\n            font-weight: bold;\n            letter-spacing: 2px;\n            margin: 8px 0;\n            backdrop-filter: blur(10px);\n        }\n\n        .qr-section {\n            margin: 8px 0;\n        }\n\n        .qr-container {\n            background: white;\n            border-radius: 8px;\n            padding: 8px;\n            display: inline-block;\n            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);\n        }\n\n        .qr-code {\n            width: 70px;\n            height: 70px;\n            background: white;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n        }\n\n        .qr-code img {\n            width: 100%;\n            height: 100%;\n            display: block;\n        }\n\n        .qr-label {\n            font-size: 10px;\n            margin-top: 8px;\n            opacity: 0.8;\n        }\n\n        .footer {\n            text-align: center;\n            background: rgba(0, 0, 0, 0.2);\n            padding: 10px;\n            border-radius: 10px;\n            margin-top: 5px;\n        }\n\n        .expiry {\n            font-size: 13px;\n            font-weight: bold;\n            color: #ffd700;\n            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);\n        }\n    </style>\n</head>\n<body>\n    <div class=\"promo-card\">\n        <div class=\"header\">\n            <div class=\"logo\">🎁</div>\n            <h1 class=\"title\">SPECIAL OFFER</h1>\n        </div>\n        \n        <div class=\"content\">\n            <h2 class=\"greeting\">Hi {{ $('Edit Fields').item.json.name }}!</h2>\n            \n            <div class=\"discount-circle\">\n                <span class=\"discount-value\">{{ $('Edit Fields').item.json.discount_value }}</span>\n                <span class=\"discount-text\">OFF</span>\n            </div>\n            \n            <div class=\"promo-code\">{{ $('Edit Fields').item.json.promo_code }}</div>\n            \n            <div class=\"qr-section\">\n                <div class=\"qr-container\">\n                    <div class=\"qr-code\">\n                        <img src=\"https://api.qrserver.com/v1/create-qr-code/?size=70x70&data=https://YOURSTORE.com/checkout?code={{ $('Edit Fields').item.json.promo_code }}&format=png&margin=0\" alt=\"QR Code\">\n                    </div>\n                </div>\n                <p class=\"qr-label\">Scan to Apply</p>\n            </div>\n        </div>\n        \n        <div class=\"footer\">\n            <p class=\"expiry\">Valid until Dec 31, 2024</p>\n        </div>\n    </div>\n</body>\n</html>",
        "response_format_html": "png"
      },
      "credentials": {
        "htmlcsstoimgApi": {
          "id": "YOUR_HTMLCSSTOIMG_API_KEY",
          "name": "Htmlcsstoimg API"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9e1bca1c-4f75-47ad-8a7c-9e42b5b7f776",
      "name": "Journaliser la distribution des promotions",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2272,
        688
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('Edit Fields').item.json.name }}",
            "Email": "={{ $('Edit Fields').item.json.email }}",
            "Status": "Sent Successfully",
            "Timestamp": "={{new Date().toISOString()}}",
            "Promo Code": "={{ $('Edit Fields').item.json.promo_code }}",
            "Discount Value": "={{ $('Edit Fields').item.json.discount_value }}"
          },
          "schema": [
            {
              "id": "Timestamp",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Timestamp",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Email",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Email",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Promo Code",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Promo Code",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Discount Value",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Discount Value",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_ID/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_GOOGLE_SHEETS_ID",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/YOUR_GOOGLE_SHEETS_ID/edit?usp=drivesdk",
          "cachedResultName": "Log Promo Distribution"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "YOUR_GOOGLE_SHEETS_OAUTH2_API_KEY",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "bcea2cef-11a1-4b63-a09f-8726ed5a0aa8",
      "name": "Définir les données d'erreur",
      "type": "n8n-nodes-base.set",
      "position": [
        1488,
        1008
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8c20bbf9-4758-499e-938c-d4a2efc7ca01",
              "name": "error_type",
              "type": "string",
              "value": "Invalid Email"
            },
            {
              "id": "ac6e79cc-a747-4a86-bdb5-f214e94dacfe",
              "name": "timestamp",
              "type": "string",
              "value": "={{new Date().toISOString()}}"
            },
            {
              "id": "b1ccacdf-c151-4107-adc0-eb3f21a5d927",
              "name": "email",
              "type": "string",
              "value": "={{ $('Edit Fields').item.json.email }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7135f609-3571-46c0-ba3d-79d9095109d8",
      "name": "Note adhésive",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        480
      ],
      "parameters": {
        "color": 7,
        "width": 416,
        "height": 480,
        "content": "## PROMO SIGNUP TRIGGER\n\n- API: Promo code signup webhook\n- Method: POST\n- Response: 200 OK with confirmation\n- Expected JSON:\n  ```json\n  {\n    \"name\": \"John Doe\",\n    \"email\": \"customer@email.com\",\n    \"promo_code\": \"SAVE20\",\n    \"discount_value\": \"20%\"\n  }\n  ```\n- Test URL: https://your-n8n-instance.com/webhook/promo-signup\n"
      },
      "typeVersion": 1
    },
    {
      "id": "5c7ce862-2a12-4348-9d59-2c4aa3463cb4",
      "name": "WEBHOOK",
      "type": "n8n-nodes-base.webhook",
      "position": [
        352,
        816
      ],
      "webhookId": "",
      "parameters": {
        "path": "promo-signup",
        "options": {
          "responseData": "={\"status\": \"success\", \"message\": \"Promo card being generated!\"}"
        },
        "httpMethod": "POST"
      },
      "typeVersion": 2.1
    },
    {
      "id": "d5bc4d1a-727d-4a2c-b038-f8f68c8b5573",
      "name": "Note adhésive 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        496
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 480,
        "content": "## DATA SANITIZATION\n\n- Purpose: Clean and prepare incoming data\n- Operations:\n  - Trim whitespace from all fields\n  - Set default values for missing data\n  - Add timestamp for tracking\n  - Validate required fields exist\n  - Normalize discount format\n- Output: Structured data for verification\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "32e56db6-94ef-4d63-ba29-c58024a643d3",
      "name": "Valider l'email",
      "type": "n8n-nodes-verifiemail.verifiEmail",
      "position": [
        880,
        816
      ],
      "parameters": {
        "email": "={{ $json.email }}"
      },
      "credentials": {
        "verifiEmailApi": {
          "id": "YOUR_VERIFI_EMAIL_API_KEY",
          "name": "VerifiEmail API"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4e0776eb-8e47-4d6b-bfc4-48495480514a",
      "name": "Note adhésive 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        480
      ],
      "parameters": {
        "color": 7,
        "width": 224,
        "height": 496,
        "content": "## EMAIL VALIDATION\n\n- Purpose: Block disposable/invalid emails\n- Check Types:\n  - Syntax validation\n  - Domain verification\n  - Mailbox existence\n  - Disposable email detection\n- Result: Valid/invalid status for IF node\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f6a6612d-7e62-45de-8b02-2b06a848a7f3",
      "name": "Note adhésive 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        528
      ],
      "parameters": {
        "color": 7,
        "width": 288,
        "height": 416,
        "content": "## VALIDATION GATEWAY\n\n- Purpose: Route based on email validity\n- TRUE Branch: Valid email → Generate card\n- FALSE Branch: Invalid email → Error handling\n- Condition: valid = \"true\" OR \"false\"\n- Prevents: Fraud and maintains list quality\n"
      },
      "typeVersion": 1
    },
    {
      "id": "25536778-aefe-45e5-81f1-01006ca85aa7",
      "name": "Passerelle de validation",
      "type": "n8n-nodes-base.if",
      "position": [
        1152,
        816
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "f7f7e28c-6bf9-4443-8c94-2431a93c354d",
              "operator": {
                "type": "boolean",
                "operation": "equals"
              },
              "leftValue": "={{ $json.valid }}",
              "rightValue": true
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "75b3e1f0-1a0c-452c-ae8b-24e22d5d0cda",
      "name": "Note adhésive 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1408,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 336,
        "height": 480,
        "content": "## PROMO CARD GENERATION\n\n- Purpose: Create personalized promo cards\n- Service: HTML to Image API\n- Template: Professional gradient design\n- Variables: {{name}}, {{promo_code}}, {{discount_value}}\n- QR Code: Embedded checkout link\n- Output: PNG image URL for email attachment\n- Size: 400x500px optimized for email\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "29103362-5f8e-48a8-bcfc-3809cbd69d29",
      "name": "Note adhésive 5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1776,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 480,
        "content": "## CUSTOMER EMAIL DELIVERY\n\n- Purpose: Send promo card to verified customers\n- To: {{email}} (validated customer)\n- Subject: \"🎉 Your Exclusive {{discount_value}} Discount is Ready!\"\n- Type: HTML with personalized content\n- Attachment: Generated promo card image\n- Includes: Welcome message, usage instructions\n"
      },
      "typeVersion": 1
    },
    {
      "id": "51f09284-6a75-4f29-9fbc-b98778d7f47f",
      "name": "Chemin de succès",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1904,
        688
      ],
      "webhookId": "",
      "parameters": {
        "sendTo": "={{ $('Edit Fields').item.json.email }}",
        "message": "=<!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>Your Exclusive Offer</title>\n</head>\n<body style=\"margin: 0; padding: 0; font-family: 'Arial', 'Helvetica', sans-serif; background-color: #f4f4f4;\">\n    <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color: #f4f4f4; padding: 20px 0;\">\n        <tr>\n            <td align=\"center\">\n                <table width=\"600\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color: #ffffff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.1);\">\n                    \n                    <!-- Header with gradient -->\n                    <tr>\n                        <td style=\"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 40px 30px; text-align: center;\">\n                            <h1 style=\"margin: 0; color: #ffffff; font-size: 32px; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.2);\">\n                                🎉 Welcome, {{ $('Edit Fields').item.json.name }}!\n                            </h1>\n                            <p style=\"margin: 10px 0 0 0; color: #ffffff; font-size: 16px; opacity: 0.95;\">\n                                Your exclusive offer is ready!\n                            </p>\n                        </td>\n                    </tr>\n                    \n                    <!-- Main Content -->\n                    <tr>\n                        <td style=\"padding: 40px 30px;\">\n                            <p style=\"margin: 0 0 20px 0; color: #333333; font-size: 16px; line-height: 1.6;\">\n                                Thank you for signing up! We're thrilled to have you join our community. \n                                As a warm welcome, we've prepared something special just for you.\n                            </p>\n                            \n                            <!-- Promo Code Box -->\n                            <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin: 30px 0;\">\n                                <tr>\n                                    <td style=\"background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 12px; padding: 30px; text-align: center;\">\n                                        <p style=\"margin: 0 0 10px 0; color: #ffffff; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9;\">\n                                            Your Exclusive Promo Code\n                                        </p>\n                                        <div style=\"background-color: rgba(255,255,255,0.2); border: 2px dashed rgba(255,255,255,0.5); border-radius: 8px; padding: 15px 25px; display: inline-block; margin: 10px 0;\">\n                                            <p style=\"margin: 0; color: #ffffff; font-size: 28px; font-weight: bold; letter-spacing: 3px;\">\n                                                {{ $('Edit Fields').item.json.promo_code }}\n                                            </p>\n                                        </div>\n                                        <p style=\"margin: 15px 0 0 0; color: #ffd700; font-size: 20px; font-weight: bold;\">\n                                            Save {{ $('Edit Fields').item.json.discount_value }}!\n                                        </p>\n                                    </td>\n                                </tr>\n                            </table>\n                            \n                            <!-- Features -->\n                            <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin: 30px 0;\">\n                                <tr>\n                                    <td width=\"33%\" style=\"padding: 15px; text-align: center; vertical-align: top;\">\n                                        <div style=\"font-size: 32px; margin-bottom: 10px;\">✨</div>\n                                        <p style=\"margin: 0; color: #667eea; font-weight: bold; font-size: 14px;\">Easy to Use</p>\n                                        <p style=\"margin: 5px 0 0 0; color: #666666; font-size: 12px;\">Apply at checkout</p>\n                                    </td>\n                                    <td width=\"33%\" style=\"padding: 15px; text-align: center; vertical-align: top;\">\n                                        <div style=\"font-size: 32px; margin-bottom: 10px;\">🎁</div>\n                                        <p style=\"margin: 0; color: #667eea; font-weight: bold; font-size: 14px;\">Exclusive Deal</p>\n                                        <p style=\"margin: 5px 0 0 0; color: #666666; font-size: 12px;\">Just for you</p>\n                                    </td>\n                                    <td width=\"33%\" style=\"padding: 15px; text-align: center; vertical-align: top;\">\n                                        <div style=\"font-size: 32px; margin-bottom: 10px;\">⏰</div>\n                                        <p style=\"margin: 0; color: #667eea; font-weight: bold; font-size: 14px;\">Limited Time</p>\n                                        <p style=\"margin: 5px 0 0 0; color: #666666; font-size: 12px;\">Don't miss out</p>\n                                    </td>\n                                </tr>\n                            </table>\n                            \n                            <p style=\"margin: 25px 0; color: #333333; font-size: 16px; line-height: 1.6;\">\n                                We've also created a beautiful promo card for you (see attachment). \n                                Save it or share it with friends!\n                            </p>\n                            \n                            <!-- CTA Button -->\n                            <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin: 30px 0;\">\n                                <tr>\n                                    <td align=\"center\">\n                                        <a href=\"#\" style=\"display: inline-block; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #ffffff; text-decoration: none; padding: 15px 40px; border-radius: 25px; font-size: 16px; font-weight: bold; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);\">\n                                            Start Shopping Now\n                                        </a>\n                                    </td>\n                                </tr>\n                            </table>\n                            \n                            <p style=\"margin: 25px 0 0 0; color: #333333; font-size: 16px; line-height: 1.6;\">\n                                Happy shopping! 🛍️\n                            </p>\n                            <p style=\"margin: 5px 0 0 0; color: #666666; font-size: 14px; font-style: italic;\">\n                                We can't wait to see what you choose!\n                            </p>\n                            \n                            <!-- Promo Card Image -->\n                            <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin: 30px 0;\">\n                                <tr>\n                                    <td align=\"center\">\n                                        <p style=\"margin: 0 0 15px 0; color: #333333; font-size: 16px; font-weight: bold;\">\n                                            Your Personalized Promo Card\n                                        </p>\n                                        <img src=\"{{ $json.image_url }}\" alt=\"Your Promo Card\" style=\"max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);\" />\n                                    </td>\n                                </tr>\n                            </table>\n                        </td>\n                    </tr>\n                    \n                    <!-- Footer -->\n                    <tr>\n                        <td style=\"background-color: #f8f8f8; padding: 25px 30px; text-align: center; border-top: 1px solid #eeeeee;\">\n                            <p style=\"margin: 0 0 10px 0; color: #999999; font-size: 12px;\">\n                                This offer is valid until Dec 31, 2024\n                            </p>\n                            <p style=\"margin: 0; color: #999999; font-size: 12px;\">\n                                Questions? Contact us at support@yourstore.com\n                            </p>\n                        </td>\n                    </tr>\n                    \n                </table>\n            </td>\n        </tr>\n    </table>\n</body>\n</html>",
        "options": {},
        "subject": "=🎉 Your Exclusive {{ $('Edit Fields').item.json.discount_value }} Discount is Ready!"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "YOUR_GMAIL_OAUTH2_API_KEY",
          "name": "Gmail OAuth2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "f7a274d9-a415-457c-8948-756bd04fead3",
      "name": "Note adhésive 6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2144,
        352
      ],
      "parameters": {
        "color": 7,
        "width": 352,
        "height": 496,
        "content": "## ANALYTICS TRACKING\n\n- Purpose: Record all successful distributions\n- Google Sheets columns:\n  - Timestamp\n  - Customer Name\n  - Email Address\n  - Promo Code\n  - Discount Value\n  - Delivery Status\n- Used for: Reporting, duplicate prevention, analytics"
      },
      "typeVersion": 1
    },
    {
      "id": "07c54abb-da63-4e5f-9707-ff9193b9a169",
      "name": "Note adhésive 7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1424,
        992
      ],
      "parameters": {
        "color": 7,
        "width": 256,
        "height": 464,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n## ERROR LOGGING\n\n- Purpose: Capture failed validation attempts\n- Data Collected:\n  - Invalid email address\n  - Reason for failure\n  - Timestamp\n  - User details (if available)\n- Prevents: Spam, fraud, system abuse\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9fb1926d-d407-4272-811c-a116658f482b",
      "name": "Chemin d'erreur",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1824,
        1008
      ],
      "webhookId": "",
      "parameters": {
        "sendTo": "YOUR_ADMIN_EMAIL_HERE",
        "message": "=Failed to generate promo card for {{ $('Edit Fields').item.json.email }} - Invalid email address",
        "options": {},
        "subject": "⚠️ Failed Promo Card Generation  ",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "id": "YOUR_GMAIL_OAUTH2_API_KEY",
          "name": "Gmail OAuth2"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "c61c8af0-85bd-41d7-a310-d56056d2b4d1",
      "name": "Note adhésive 8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        992
      ],
      "parameters": {
        "color": 7,
        "width": 336,
        "height": 416,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n## ADMIN NOTIFICATION\n\n- Purpose: Alert team of invalid attempts\n- To: YOUR_ADMIN_EMAIL_HERE\n- Subject: \"⚠️ Failed Promo Card Generation\"\n- Content: Error details and user information\n- Helps: Monitor system health, detect patterns"
      },
      "typeVersion": 1
    },
    {
      "id": "80c29be0-1ebe-431b-8c78-3c6c46019418",
      "name": "Note adhésive 9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -608,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 592,
        "height": 784,
        "content": "## AUTOMATED PROMO CARD GENERATOR\n\n- Purpose: Generate personalized discount cards with email verification\n\n**Workflow:**  \nWebhook → Email Verification → Card Creation → Email → Sheets Log  \n\n**Highlights:**  \n- Fraud prevention  \n- Personalized promo visuals  \n- Automated customer mailing  \n- Real-time Google Sheets logging  \n\n**APIs Used & Where to Get Keys:**\n\n1️⃣ **Verifi Email API** – for email verification  \n🔗 Get API key from: [https://verifi.email](https://verifi.email) \n\n2️⃣ **HTML to Image API** – for converting HTML promo card to image  \n🔗 Get API key from: [https://htmlcsstoimg.com](https://htmlcsstoimg.com)  \n\n3️⃣ **Gmail API** – for sending personalized promo emails  \n🔗 Get credentials from: [https://console.cloud.google.com/](https://console.cloud.google.com/)  \n➡️ Create project → Enable Gmail API → Generate OAuth 2.0 Client ID  \n\n4️⃣ **Google Sheets API** – for logging promo data  \n🔗 Get credentials from: [https://console.cloud.google.com/](https://console.cloud.google.com/)  \n➡️ Enable Google Sheets API → Create Service Account → Download JSON key  \n\n- Processing: 30-60 seconds per request\n- Success Rate: 95%+ for valid emails\n- Monitoring:\n  - Email verification rates\n  - Image generation failures\n  - Delivery metrics\n  - API usage limits\n\n\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "",
  "connections": {
    "5c7ce862-2a12-4348-9d59-2c4aa3463cb4": {
      "main": [
        [
          {
            "node": "b0df3843-bc98-4a04-b9c5-587df865c8d3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b0df3843-bc98-4a04-b9c5-587df865c8d3": {
      "main": [
        [
          {
            "node": "32e56db6-94ef-4d63-ba29-c58024a643d3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "51f09284-6a75-4f29-9fbc-b98778d7f47f": {
      "main": [
        [
          {
            "node": "9e1bca1c-4f75-47ad-8a7c-9e42b5b7f776",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bcea2cef-11a1-4b63-a09f-8726ed5a0aa8": {
      "main": [
        [
          {
            "node": "9fb1926d-d407-4272-811c-a116658f482b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "32e56db6-94ef-4d63-ba29-c58024a643d3": {
      "main": [
        [
          {
            "node": "25536778-aefe-45e5-81f1-01006ca85aa7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "25536778-aefe-45e5-81f1-01006ca85aa7": {
      "main": [
        [
          {
            "node": "af6b8362-eea0-47fa-a524-d8053150504f",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "bcea2cef-11a1-4b63-a09f-8726ed5a0aa8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "af6b8362-eea0-47fa-a524-d8053150504f": {
      "main": [
        [
          {
            "node": "51f09284-6a75-4f29-9fbc-b98778d7f47f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Foire aux questions

Comment utiliser ce workflow ?

Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.

Dans quelles scénarios ce workflow est-il adapté ?

Avancé - Réseaux sociaux

Est-ce payant ?

Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.

Informations sur le workflow
Niveau de difficulté
Avancé
Nombre de nœuds19
Catégorie1
Types de nœuds8
Description de la difficulté

Adapté aux utilisateurs avancés, avec des workflows complexes contenant 16+ nœuds

Auteur
Jitesh Dugar

Jitesh Dugar

@jiteshdugar

AI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.

Liens externes
Voir sur n8n.io

Partager ce workflow

Catégories

Catégories: 34