{ "name": "Create Nextcloud Deck Cards from Email", "nodes": [ { "name": "IMAP Email", "type": "n8n-nodes-base.emailReadImap", "notes": "Check email", "position": [ 480, 140 ], "parameters": { "options": {} }, "notesInFlow": true, "typeVersion": 1, "id": "create-nextcloud-deck-cards-from-email-0" }, { "name": "Prepare the Deck card", "type": "n8n-nodes-base.code", "notes": "Strip HTML code", "position": [ 730, 140 ], "parameters": { "mode": "runOnceForEachItem", "jsCode": "const subject=$json.subject,html=$json.textHtml,text=$json.textPlain;if(typeof subject!=='string'||!subject.trim()||subject.length>255)throw Error('Deck card title must contain 1 to 255 characters');const body=typeof html==='string'&&html?html.replace(//g,'\\n').replace(/(<([^>]+)>)/g,''):typeof text==='string'?text:null;if(body===null)throw Error('Email body is missing');return {json:{title:subject,type:'plain',order:-1,description:body}};" }, "notesInFlow": true, "typeVersion": 2, "id": "create-nextcloud-deck-cards-from-email-1" }, { "name": "Create the Deck card", "type": "n8n-nodes-base.httpRequest", "notes": "Add card to Nextcloud Deck App. Configure board / stack id to your environment.", "position": [ 970, 140 ], "parameters": { "method": "POST", "url": "https://YOUR_NEXTCLOUD_HOST/index.php/apps/deck/api/v1.0/boards/YOUR_BOARD_ID/stacks/YOUR_STACK_ID/cards", "authentication": "genericCredentialType", "genericAuthType": "httpBasicAuth", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "OCS-APIRequest", "value": "true" } ] }, "sendBody": true, "contentType": "json", "specifyBody": "json", "jsonBody": "={{ $json }}", "options": {} }, "notesInFlow": true, "typeVersion": 4.2, "id": "create-nextcloud-deck-cards-from-email-2" } ], "active": false, "settings": {}, "connections": { "IMAP Email": { "main": [ [ { "node": "Prepare the Deck card", "type": "main", "index": 0 } ] ] }, "Prepare the Deck card": { "main": [ [ { "node": "Create the Deck card", "type": "main", "index": 0 } ] ] } }, "pinData": {} }