{
  "name": "SendInbox — событие письма → действие",
  "meta": { "templateId": "sendinbox-event-to-action" },
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "sendinbox-event",
        "options": {}
      },
      "id": "b1a1e000-0000-4000-8000-000000000001",
      "name": "SendInbox: событие (webhook)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [260, 300],
      "webhookId": "sendinbox-event"
    },
    {
      "parameters": {
        "conditions": {
          "options": { "caseSensitive": true, "typeValidation": "strict" },
          "conditions": [
            {
              "leftValue": "={{ $json.body.type }}",
              "rightValue": "click",
              "operator": { "type": "string", "operation": "equals" }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "b1a1e000-0000-4000-8000-000000000002",
      "name": "Это клик?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [520, 300]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://app.working-esender.ru/api/v1/emails",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"to\": \"{{ $json.body.email }}\",\n  \"from\": { \"email\": \"news@ВАШ-ДОМЕН.ru\", \"name\": \"SendInbox\" },\n  \"subject\": \"Спасибо за интерес!\",\n  \"text\": \"Вы кликнули по ссылке — держите бонус.\"\n}",
        "options": {}
      },
      "id": "b1a1e000-0000-4000-8000-000000000003",
      "name": "SendInbox: отправить письмо",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [800, 220],
      "credentials": {
        "httpHeaderAuth": { "id": "REPLACE_WITH_CREDENTIAL_ID", "name": "SendInbox API" }
      }
    }
  ],
  "connections": {
    "SendInbox: событие (webhook)": {
      "main": [[{ "node": "Это клик?", "type": "main", "index": 0 }]]
    },
    "Это клик?": {
      "main": [[{ "node": "SendInbox: отправить письмо", "type": "main", "index": 0 }], []]
    }
  },
  "settings": { "executionOrder": "v1" },
  "pinData": {}
}
