{
  "id": "KKQJKkfiLQQ48JSW",
  "name": "Send Postcards to Contacts Automatically using CentralStationCRM and EchtPost",
  "tags": [],
  "nodes": [
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        -140
      ],
      "parameters": {
        "width": 400,
        "height": 920,
        "content": "![CSCRM Logo](https://s3.42he.com/cscrm-marketing-page-production/Logo_Central_Station_CRM_0dd02e23d2.jpeg)\n\n# Send Postcards to Contacts Automatically using CentralStationCRM and EchtPost\n\nIn this workflow, you send a **postcard** to a person newly created in CentralStationCRM.\n\n* the workflow is triggered when a person is updated in the CRM\n* the blue set node filters the data required for EchtPost\n* the green if node checks whether the word \u201cEchtPost\u201d appears in the tags\n* if yes, a card is sent via the EchtPost API\n\n\n\n\n\n\n*To edit the nodes in steps 2 and 5: Simply double-click!*\n\n*At the very end: Set the workflow switch to Active!*\n\n*Don't forget to save your work!*"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1600,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 440,
        "height": 680,
        "content": "## 3. get EchtPost API key\n* Log in to EchtPost\n* Click on the cogwheel at the top right\n![API EchtPost](https://s3.42he.com/cscrm-marketing-page-production/Echt_Post_API_Schluessel_24d1c6be44.png)\n* Click on \"Create API key\n* Enter description (e.g. \"n8n\")\n* Copy API key\n\n## 4. get EchtPost template ID\n![EchtPost Navbar](https://s3.42he.com/cscrm-marketing-page-production/Echt_Post_Vorlagen_1592063ee7.png)\n* Click on the desired template\n* Copy the number after ?template_id= in the URL"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 500,
        "height": 840,
        "content": "## 5. Configure EchtPost API Node\n* Double-click node\n* METHOD: POST\n* https://api.echtpost.de/v1/cards\n* Authentication: none\n* SEND BODY: True\n* Body Content Type: JSON\n* Specify Body: Using JSON\n\nJSON Code (Important: Switch to \"Expression\"!)\n* Replace key, template ID and mail with your own values\n\n\n{\n \"apikey\": \"ENTER HERE-API-KEY\",\n \"card\": {\n \"template_id\": \"HERE-TEMPLATE-ID\",\n \"deliver_at\": \"3-days-from-now\", \"\n \" \"notification_type\": \"before_send\",\n \"notification_email\": \"YOUR EMAIL\",\n \"contacts_attributes\": [\n {\n \"company_name\": \"{{ $json.body.record.companies[0].name }}\",\n \"street\": \"{{ $json.body.record.addrs[0].street }}\",\n \"zip\": \"{{ $json.body.record.addrs[0].zip }}\", \"\n city\": \"{{ $json.body.record.addrs[0].city }}\", \"\n country_code\": \"{{ $json.body.record.addrs[0].country_code }}\"\n      }\n    ]\n  }\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -20
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 960,
        "content": "## 2. set up CentralStationCRM Webhook\n* log in to CentralStationCRM\n* click on the gear wheel at the top right\n\n![Account settings](https://s3.42he.com/cscrm-marketing-page-production/CSCRM_Settings_edb73dede7.jpg)\n![Webhook](https://s3.42he.com/cscrm-marketing-page-production/CSCRM_Settings_Webhook_0b20350753.jpg)\n* click \"Create webhook\"\n* enter password\n* \"Monitored object type\": Person\n* \"Monitored event\": Update\n* for \"Endpoint URL\" enter webhook URL\n* enter the following for \"Nested objects\":\ntags, addrs, companies\n* enter name and description (e.g. n8n Test)\n* set status to active and save"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1220,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 340,
        "height": 1080,
        "content": "## 2. Set up n8n webhook trigger\n* double-click node\n* HTTP Method: POST\n* Authentication: none\n\n### For testing: \nTag a person in CentralStationCRM with \"EchtPost\" and click on \"Listen for Test Event\" on the node shortly beforehand. The webhook should be triggered and the data transferred to the node.\n\n### For operation:\n* Switch from \"Test URL\" to \"Production URL\"\n* Copy new webhook URL (click on it)\n* Enter new URL under \"Endpoint URL\" in the CentralStationCRM webhook created in step 2"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        320,
        820
      ],
      "parameters": {
        "width": 400,
        "height": 120,
        "content": "### Tools in this workflow\n* [CentralStationCRM](https://centralstationcrm.de) - the simple and intuitive CRM for small teams.\n* [EchtPost](https://echtpost.de) - send postcards online"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -140
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 100,
        "content": "## 1. get webhook URL from n8n\n* Double-click the first node in the workflow\n* Click once on the url next to POST"
      },
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Person is updated in CentralStationCRM",
      "type": "n8n-nodes-base.webhook",
      "position": [
        1320,
        640
      ],
      "parameters": {
        "path": "aa45aef4-1eff-46b8-9b72-4240a40b2f6c",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Set fields needed for EchtPost",
      "type": "n8n-nodes-base.set",
      "position": [
        1640,
        640
      ],
      "parameters": {
        "include": "selected",
        "options": {},
        "includeFields": "body.record.companies[0].name, body.record.addrs[0].street, body.record.addrs[0].zip, body.record.addrs[0].city, body.record.addrs[0].country_code, body.record.taggings",
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Is \"EchtPost\" included in \"taggings\"?",
      "type": "n8n-nodes-base.if",
      "position": [
        1860,
        640
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "YOUR_CREDENTIAL_ID",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{ $json.taggings }}",
              "rightValue": "\"EchtPost\""
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.2
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        2260,
        780
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "YOUR_CREDENTIAL_ID",
      "name": "Send postcard with EchtPost",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2260,
        520
      ],
      "parameters": {
        "url": "https://api.echtpost.de/v1/cards",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"apikey\": \"HIER-API-KEY-EINTRAGEN\",\n  \"card\": {\n    \"template_id\": \"HIER-TEMPLATE-ID\",\n    \"deliver_at\": \"3-days-from-now\",\n    \"notification_type\": \"before_send\",\n    \"notification_email\": \"EMAIL EINTRAGEN\",\n    \"contacts_attributes\": [\n      {\n        \"company_name\": \"{{ $json.name }}\",\n        \"street\": \"{{ $json.street }}\",\n        \"zip\": \"{{ $json.zip }}\",\n        \"city\": \"{{ $json.city }}\",\n        \"country_code\": \"{{ $json.country_code }}\"\n      }\n    ]\n  }\n}",
        "sendBody": true,
        "specifyBody": "json"
      },
      "typeVersion": 4.2
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "152242be-1fe6-4528-999d-993fb0593528",
  "connections": {
    "Set fields needed for EchtPost": {
      "main": [
        [
          {
            "node": "Is \"EchtPost\" included in \"taggings\"?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is \"EchtPost\" included in \"taggings\"?": {
      "main": [
        [
          {
            "node": "Send postcard with EchtPost",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Person is updated in CentralStationCRM": {
      "main": [
        [
          {
            "node": "Set fields needed for EchtPost",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}