{ "meta": { "instanceId": "04ab549d8bbb435ec33b81e4e29965c46cf6f0f9e7afe631018b5e34c8eead58" }, "nodes": [ { "id": "b1b6eb50-9d42-484d-9488-0607be2143d8", "name": "Session", "type": "n8n-nodes-base.httpRequest", "position": [ -160, -200 ], "parameters": { "url": "https://api.fastmail.com/jmap/session", "options": {}, "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth" }, "credentials": { "httpHeaderAuth": { "id": "BWkbkxgDD4hkRCvs", "name": "Fastmail Masked E-Mail Addresses" } }, "typeVersion": 4.2 }, { "id": "aca05a94-07dd-4408-8d87-47e788a5f0a8", "name": "get all masked emails", "type": "n8n-nodes-base.httpRequest", "notes": "https://api.fastmail.com/.well-known/jmap\n\nhttps://api.fastmail.com/jmap/session", "position": [ 700, -200 ], "parameters": { "url": "https://api.fastmail.com/jmap/api/", "method": "POST", "options": {}, "jsonBody": "={\n \"using\": [\"urn:ietf:params:jmap:core\", \"https://www.fastmail.com/dev/maskedemail\"],\n \"methodCalls\": [\n [\n \"MaskedEmail/get\",\n {\n \"accountId\": \"{{ $('Session').item.json.primaryAccounts['https://www.fastmail.com/dev/maskedemail'] }}\"\n },\n \"c1\"\n ]\n ]\n}", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] } }, "credentials": { "httpHeaderAuth": { "id": "BWkbkxgDD4hkRCvs", "name": "Fastmail Masked E-Mail Addresses" } }, "typeVersion": 4.2 }, { "id": "c4337bb4-1c16-4381-abe4-f0699099f326", "name": "create random masked email", "type": "n8n-nodes-base.httpRequest", "notes": "https://api.fastmail.com/.well-known/jmap\n\nhttps://api.fastmail.com/jmap/session", "position": [ 540, 40 ], "parameters": { "url": "https://api.fastmail.com/jmap/api/", "method": "POST", "options": {}, "jsonBody": "={\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"https://www.fastmail.com/dev/maskedemail\"\n ],\n \"methodCalls\": [\n [\n \"MaskedEmail/set\",\n {\n \"accountId\": \"{{ $('Session').item.json.primaryAccounts['https://www.fastmail.com/dev/maskedemail'] }}\",\n \"create\": {\n \"maskedEmailId1\": {\n \"description\": \"Test via N8n\",\n \"state\": \"{{ $('Webhook').item.json.body.state }}\",\n \"id\": \"{{ $('Webhook').item.json.body.id }}\",\n \"email\": \"{{ $('Webhook').item.json.body.email }}\"\n }\n }\n },\n \"c1\"\n ]\n ]\n}\n", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] } }, "credentials": { "httpHeaderAuth": { "id": "BWkbkxgDD4hkRCvs", "name": "Fastmail Masked E-Mail Addresses" } }, "typeVersion": 4.2 }, { "id": "bbfae2d8-d23a-4244-8566-c3da9cc2e34d", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [ 1320, -200 ], "parameters": { "options": {}, "respondWith": "text", "responseBody": "={{ $json.html }}" }, "typeVersion": 1.1 }, { "id": "af8ac7a4-116f-41ef-b6c0-72006fb47474", "name": "Switch", "type": "n8n-nodes-base.switch", "position": [ 60, -200 ], "parameters": { "rules": { "values": [ { "outputKey": "pending", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "operator": { "type": "string", "operation": "equals" }, "leftValue": "={{ $('Webhook').item.json.body.state }}", "rightValue": "pending" } ] }, "renameOutput": true }, { "outputKey": "enabled", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "56e6f1b8-0331-4c2d-aa90-e639752cfa9d", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $('Webhook').item.json.body.state }}", "rightValue": "enabled" } ] }, "renameOutput": true }, { "outputKey": "deleted", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "32f59847-a58c-4d8b-b1ae-48b8d4dad1a3", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $('Webhook').item.json.body.state }}", "rightValue": "deleted" } ] }, "renameOutput": true }, { "outputKey": "disabled", "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "cc39f7c0-3960-49d9-ae21-9f1f35714015", "operator": { "name": "filter.operator.equals", "type": "string", "operation": "equals" }, "leftValue": "={{ $('Webhook').item.json.body.state }}", "rightValue": "disabled" } ] }, "renameOutput": true } ] }, "options": { "fallbackOutput": "extra" } }, "typeVersion": 3.2 }, { "id": "ceca9fc2-e2f4-4578-8313-c987d08e9393", "name": "disabled", "type": "n8n-nodes-base.httpRequest", "notes": "https://api.fastmail.com/.well-known/jmap\n\nhttps://api.fastmail.com/jmap/session", "position": [ 540, 500 ], "parameters": { "url": "https://api.fastmail.com/jmap/api/", "method": "POST", "options": {}, "jsonBody": "={\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"https://www.fastmail.com/dev/maskedemail\"\n ],\n \"methodCalls\": [\n [\n \"MaskedEmail/set\",\n {\n \"accountId\": \"{{ $('Session').item.json.primaryAccounts['https://www.fastmail.com/dev/maskedemail'] }}\",\n \"update\": {\n \"{{ $('Webhook').item.json.body.id }}\": {\n \"state\": \"{{ $('Webhook').item.json.body.state }}\"\n }\n }\n },\n \"c1\"\n ]\n ]\n}\n", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] } }, "credentials": { "httpHeaderAuth": { "id": "BWkbkxgDD4hkRCvs", "name": "Fastmail Masked E-Mail Addresses" } }, "typeVersion": 4.2 }, { "id": "c0467dec-a29e-42a0-8f81-fb12b0428974", "name": "delete", "type": "n8n-nodes-base.httpRequest", "notes": "https://api.fastmail.com/.well-known/jmap\n\nhttps://api.fastmail.com/jmap/session", "position": [ 540, 280 ], "parameters": { "url": "https://api.fastmail.com/jmap/api/", "method": "POST", "options": {}, "jsonBody": "={\n \"using\": [\n \"urn:ietf:params:jmap:core\",\n \"https://www.fastmail.com/dev/maskedemail\"\n ],\n \"methodCalls\": [\n [\n \"MaskedEmail/set\",\n {\n \"accountId\": \"{{ $('Session').item.json.primaryAccounts['https://www.fastmail.com/dev/maskedemail'] }}\",\n \"destroy\": [\n \"{{ $('Webhook').item.json.body.id }}\"\n ]\n },\n \"c1\"\n ]\n ]\n }\n ", "sendBody": true, "sendHeaders": true, "specifyBody": "json", "authentication": "genericCredentialType", "genericAuthType": "httpHeaderAuth", "headerParameters": { "parameters": [ { "name": "Content-Type", "value": "application/json" } ] } }, "credentials": { "httpHeaderAuth": { "id": "BWkbkxgDD4hkRCvs", "name": "Fastmail Masked E-Mail Addresses" } }, "typeVersion": 4.2 }, { "id": "be0cdbe5-4607-44d5-8c51-7f8f1dcb4551", "name": "gather masked email list", "type": "n8n-nodes-base.set", "position": [ 920, -200 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "06210f93-1b2b-4bad-8a1d-263e57f651ca", "name": "data", "type": "array", "value": "={{ $json.methodResponses[0][1].list }}" } ] } }, "typeVersion": 3.4 }, { "id": "bd4134cf-b684-4b6e-bb58-a70ff068e2fd", "name": "create html template", "type": "n8n-nodes-base.html", "position": [ 1120, -200 ], "parameters": { "html": "\n\n
\n \n \nDescription | \nState | \nCreated By | \nCreated At | \nLast Message At | \nFor Domain | \nID | \nActions | \n
---|