{ "name": "Outlevo: Sending problems to Gmail", "nodes": [ { "id": "0082ebbf-990c-4cdf-a263-3eeb9f21b526", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -360 ], "parameters": { "content": "## How to set it up\n\n**Credentials** (n8n asks for each on first open):\n- **Outlevo API key**: a Header Auth credential, name `Authorization`, value `Bearer olv_live_…` (Settings → API keys in Outlevo).\n- **Gmail**: connect your Gmail account.\n\n**API key scopes**: `campaigns:read`.\n\n**Replace**: `you@example.com`.\n\nThen switch the workflow to **Active**.", "height": 300, "width": 620 } }, { "id": "d65a918a-8080-4cf6-99c2-18140d13d2b6", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 8 } ] } } }, { "id": "ae9eec3b-b595-4935-bf2e-d54cd9008d74", "name": "Sending health", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.2, "position": [ 240, 0 ], "parameters": { "method": "GET", "url": "=https://api.outlevo.com/v1/sending/health", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "options": {} }, "credentials": { "httpHeaderAuth": { "id": "", "name": "Outlevo API key (Authorization: Bearer olv_live_…)" } } }, { "id": "ed5f63e3-84df-4f4e-87e8-8537b827b515", "name": "Write the digest", "type": "n8n-nodes-base.code", "typeVersion": 2, "position": [ 480, 0 ], "parameters": { "mode": "runOnceForAllItems", "jsCode": "const h = $input.first().json;\nconst out = [];\nfor (const d of h.domains || []) {\n const dns = d.dns || {};\n const broken = ['spf', 'dkim', 'dmarc'].filter((k) => dns[`${k}_ok`] === false).map((k) => k.toUpperCase());\n if (broken.length) out.push(`• ${d.domain}: ${broken.join(', ')} not set up right`);\n if (d.blacklist && d.blacklist.status === 'listed') out.push(`• ${d.domain}: on a blocklist${(d.blacklist.listings || []).length ? ` (${d.blacklist.listings.map((l) => l.list).join(', ')})` : ''}`);\n}\nfor (const c of h.paused_campaigns || []) out.push(`• Campaign \"${c.name}\" paused${c.reason ? `: ${c.reason}` : ''}`);\nif (!out.length) return [];\nreturn [{ json: { text: `🚨 Sending needs a look:\\n${out.join('\\n')}\\nhttps://app.outlevo.com/campaigns`, subject: `Outlevo sending: ${out.length} problem(s)` } }];\n" } }, { "id": "043b3783-c900-4a02-a54b-ff3b30a382a6", "name": "Email it", "type": "n8n-nodes-base.gmail", "typeVersion": 2.1, "position": [ 720, 0 ], "parameters": { "sendTo": "you@example.com", "subject": "={{ $json.subject }}", "emailType": "text", "message": "={{ $json.text }}", "options": { "appendAttribution": false } }, "credentials": { "gmailOAuth2": { "id": "", "name": "Gmail" } } } ], "connections": { "Every morning": { "main": [ [ { "node": "Sending health", "type": "main", "index": 0 } ] ] }, "Sending health": { "main": [ [ { "node": "Write the digest", "type": "main", "index": 0 } ] ] }, "Write the digest": { "main": [ [ { "node": "Email it", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }