{ "name": "Outlevo: Sending problems to Microsoft Teams", "nodes": [ { "id": "0f008cf7-1e75-48f9-9081-4123c5f64df9", "name": "How to set it up", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1, "position": [ -40, -364 ], "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- **Microsoft Teams**: connect your Microsoft Teams account.\n\n**API key scopes**: `campaigns:read`.\n\n**Pick in the node**:\n- **Post to Teams**: the team and the channel\n\nThen switch the workflow to **Active**.", "height": 304, "width": 620 } }, { "id": "d1ab3c70-ea79-4841-984d-e93f9b82a6db", "name": "Every morning", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1.2, "position": [ 0, 0 ], "parameters": { "rule": { "interval": [ { "field": "days", "daysInterval": 1, "triggerAtHour": 8 } ] } } }, { "id": "6781adb5-e507-4b72-8506-b0335e70202c", "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": "a357b1cb-5e70-4280-9138-4ced9f2a4236", "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": "8f9ab075-b6a2-41e1-be7d-8c2dc6a38efe", "name": "Post to Teams", "type": "n8n-nodes-base.microsoftTeams", "typeVersion": 2, "position": [ 720, 0 ], "parameters": { "resource": "channelMessage", "operation": "create", "teamId": { "__rl": true, "mode": "list", "value": "" }, "channelId": { "__rl": true, "mode": "list", "value": "" }, "contentType": "html", "message": "={{ $json.text.split('&').join('&').split('<').join('<').split('>').join('>').split('\\n').join('
') }}", "options": { "includeLinkToWorkflow": false } }, "credentials": { "microsoftTeamsOAuth2Api": { "id": "", "name": "Microsoft Teams" } } } ], "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": "Post to Teams", "type": "main", "index": 0 } ] ] } }, "settings": { "executionOrder": "v1" }, "pinData": {}, "meta": { "templateCredsSetupCompleted": false } }