{
  "name": "ApogeoAPI \u2014 Send localized welcome email by visitor country",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "signup",
        "responseMode": "onReceived"
      },
      "name": "Webhook (form signup)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "resource": "ip",
        "operation": "geolocate",
        "ip": "={{ $json.body.ip }}"
      },
      "name": "ApogeoAPI: detect country",
      "type": "n8n-nodes-apogeoapi.apogeoapi",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "credentials": {
        "apogeoApiCredentials": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "rules": {
          "rules": [
            {
              "value2": "ES",
              "operation": "equal",
              "output": 0
            },
            {
              "value2": "AR",
              "operation": "equal",
              "output": 0
            },
            {
              "value2": "MX",
              "operation": "equal",
              "output": 0
            },
            {
              "value2": "FR",
              "operation": "equal",
              "output": 1
            },
            {
              "value2": "DE",
              "operation": "equal",
              "output": 2
            }
          ]
        },
        "value1": "={{ $json.country.iso2 }}",
        "fallbackOutput": 3
      },
      "name": "Switch by country",
      "type": "n8n-nodes-base.switch",
      "typeVersion": 1,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "fromEmail": "hello@yourdomain.com",
        "toEmail": "={{ $node['Webhook (form signup)'].json.body.email }}",
        "subject": "\u00a1Bienvenido!",
        "html": "<p>Hola {{ $node['Webhook (form signup)'].json.body.name }},</p><p>Gracias por registrarte. Te escribimos desde tu zona horaria ({{ $node['ApogeoAPI: detect country'].json.timezone.name }}).</p>"
      },
      "name": "Send Spanish",
      "type": "n8n-nodes-base.sendGrid",
      "typeVersion": 1,
      "position": [
        900,
        140
      ]
    },
    {
      "parameters": {
        "fromEmail": "hello@yourdomain.com",
        "toEmail": "={{ $node['Webhook (form signup)'].json.body.email }}",
        "subject": "Bienvenue !",
        "html": "<p>Bonjour {{ $node['Webhook (form signup)'].json.body.name }},</p><p>Merci de vous \u00eatre inscrit.</p>"
      },
      "name": "Send French",
      "type": "n8n-nodes-base.sendGrid",
      "typeVersion": 1,
      "position": [
        900,
        280
      ]
    },
    {
      "parameters": {
        "fromEmail": "hello@yourdomain.com",
        "toEmail": "={{ $node['Webhook (form signup)'].json.body.email }}",
        "subject": "Willkommen!",
        "html": "<p>Hallo {{ $node['Webhook (form signup)'].json.body.name }},</p><p>Vielen Dank f\u00fcr Ihre Anmeldung.</p>"
      },
      "name": "Send German",
      "type": "n8n-nodes-base.sendGrid",
      "typeVersion": 1,
      "position": [
        900,
        420
      ]
    },
    {
      "parameters": {
        "fromEmail": "hello@yourdomain.com",
        "toEmail": "={{ $node['Webhook (form signup)'].json.body.email }}",
        "subject": "Welcome!",
        "html": "<p>Hi {{ $node['Webhook (form signup)'].json.body.name }},</p><p>Thanks for signing up.</p>"
      },
      "name": "Send English (default)",
      "type": "n8n-nodes-base.sendGrid",
      "typeVersion": 1,
      "position": [
        900,
        560
      ]
    }
  ],
  "connections": {
    "Webhook (form signup)": {
      "main": [
        [
          {
            "node": "ApogeoAPI: detect country",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ApogeoAPI: detect country": {
      "main": [
        [
          {
            "node": "Switch by country",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch by country": {
      "main": [
        [
          {
            "node": "Send Spanish",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send French",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send German",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send English (default)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {},
  "staticData": null,
  "meta": {
    "templateCreatedBy": "ApogeoAPI",
    "description": "When a user signs up via form, detect their country from IP via ApogeoAPI, then send a welcome email in the matching language using SendGrid. Demo languages: Spanish (ES/AR/MX), French (FR), German (DE), English (default). Easy to extend \u2014 duplicate the SendGrid node and add another route to the Switch.",
    "useCases": [
      "Onboarding: localized welcome email by visitor geography",
      "B2C SaaS: tailored CTA per region",
      "Marketing: language-aware campaign automation"
    ]
  }
}