{
  "id": "KMWmaQAZoxZcWoF6",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "FFT Shop - Pickup Ready email",
  "tags": [],
  "nodes": [
    {
      "id": "e7662be9-bfe3-4188-b1b6-e4c60961952a",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1216,
        208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5303687e-4ade-4dd9-a355-e467e0993bdf",
      "name": "Check If Data is Valid",
      "type": "n8n-nodes-base.if",
      "position": [
        -224,
        16
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "b66ffd37-c7a6-4d74-b9ae-82b28a99ce1f",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.payload.customAttributes.salesSource }}",
              "rightValue": "FFT_Shop"
            },
            {
              "id": "44eb36ff-803b-45a5-a599-7f0beab886ea",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "leftValue": "={{ $json.payload.channel }}",
              "rightValue": "COLLECT"
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "49c5264e-5570-4d9c-807b-d76711ff2b48",
      "name": "Select Language",
      "type": "n8n-nodes-base.switch",
      "position": [
        1344,
        -96
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "en_US",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9e0870e1-5355-4af0-8142-0116a8b2db9a",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Handoverjob Created').item.json.payload.customAttributes.shopLanguage }}",
                    "rightValue": "en_US"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "de_DE",
              "conditions": {
                "options": {
                  "version": 3,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "2a9c06b3-5a03-4c60-a755-3c3e2287523a",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $('Handoverjob Created').item.json.payload.customAttributes.shopLanguage }}",
                    "rightValue": "de_DE"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.4
    },
    {
      "id": "658570c0-a370-4009-9e08-871742be0ada",
      "name": "Handoverjob Created",
      "type": "@fulfillmenttools/n8n-nodes-fulfillmenttools.fulfillmenttoolsTrigger",
      "position": [
        -432,
        16
      ],
      "parameters": {
        "event": "HANDOVERJOB_CREATED",
        "subscriptionName": "n8n Shop Pickup ready email"
      },
      "credentials": {
        "fulfillmenttoolsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "1acfd7f4-ae2f-4038-8aac-5210fc36f27b",
      "name": "Send pickup email english",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1888,
        -224
      ],
      "parameters": {
        "sendTo": "={{ $('Get Order by Id').item.json.consumer.addresses[0].email }}",
        "message": "=<!DOCTYPE html><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><head>\n<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n<meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\">\n<title>Ready for Pickup | fulfillmenttools Shop</title>\n<link href=\"https://fonts.googleapis.com/css2?family=Manrope:wght@400;700;800&amp;family=Inter:wght@400;500;600&amp;display=swap\" rel=\"stylesheet\">\n<style type=\"text/css\">\nbody, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }\ntable, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }\nimg { -ms-interpolation-mode: bicubic; border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }\ntable { border-collapse: collapse !important; }\nbody { margin: 0 !important; padding: 0 !important; width: 100% !important; background-color: #f3faff; }\na[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; font-size: inherit !important; font-family: inherit !important; font-weight: inherit !important; line-height: inherit !important; }\n</style></head>\n<body style=\"margin: 0; padding: 0; background-color: #f3faff; font-family: 'Inter', Helvetica, Arial, sans-serif;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background-color:#f3faff;\"><tbody><tr>\n<td align=\"center\" style=\"padding: 40px 10px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;\"><tbody>\n<tr><td align=\"left\" style=\"padding-bottom: 40px;\">\n<h1 style=\"margin: 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 32px; font-weight: 800; line-height: 40px; color: #071e27; letter-spacing: -0.02em;\">Ready to collect, {{ $('Get Order by Id').item.json.consumer.addresses[0].firstName }}!</h1>\n<p style=\"margin: 20px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; color: #414754;\">Your Click & Collect order {{ $('Get Order by Id').item.json.tenantOrderId }} is ready and waiting at your chosen store. Show your pickup code at the counter.</p></td></tr><tr><td style=\"padding-bottom: 32px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px; background-color: #e6f6ff; border-radius: 8px;\"><tbody><tr>\n<td style=\"padding: 24px 28px; border-left: 4px solid #2b5ab5;\">\n<p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #727785;\">Pickup Status</p>\n<p style=\"margin: 8px 0 0 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 24px; font-weight: 800; color: #2b5ab5;\">Ready for Pickup</p>\n<p style=\"margin: 6px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 14px; color: #414754;\">Please collect by Nov 3, 2023</p>\n</td></tr></tbody></table></td></tr><tr><td style=\"padding-bottom: 32px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px; background-color: #ffffff; border-radius: 8px; border: 1px solid #dbf1fe;\"><tbody><tr><td style=\"padding: 24px;\">\n<p style=\"margin: 0 0 20px 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #727785;\">Pickup Location</p>\n<p style=\"margin: 0 0 4px 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px; color: #414754;\">Store</p><p style=\"margin: 0 0 20px 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 700; color: #071e27;\">{{ $('Get pickup Facility').item.json.name }}</p><p style=\"margin:0 0 20px 0;font-family:'Inter', Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;color:#071e27;\">{{ $('Get pickup Facility').item.json.address.houseNumber }} {{ $('Get pickup Facility').item.json.address.street }}<br>{{ $('Get pickup Facility').item.json.address.postalCode }} {{ $('Get pickup Facility').item.json.address.city }}<br></p><p style=\"margin: 0 0 4px 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px; color: #414754;\">Pickup Code</p><p style=\"margin: 0 0 20px 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 24px; font-weight: 800; color: #2b5ab5;\">4417</p>\n</td></tr></tbody></table></td></tr><tr><td style=\"padding-bottom: 32px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px; background-color: #ffffff; border: 1px solid #dbf1fe; border-radius: 8px;\"><tbody>\n<tr><td style=\"background-color: #cfe6f2; padding: 12px 24px;\"><p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #414754;\">Reserved Items</p></td></tr>\n\n{{ $('Handoverjob Created').item.json.payload.handoverJobLineItems.map(item => `<tr>\n<td style=\"padding: 24px; border-bottom: 1px solid #dbf1fe;\" class=\"\">\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tbody><tr>\n<td valign=\"top\" width=\"80\">\n<img alt=\"${item.article.title}\" src=\"${item.article.imageUrl}\" style=\"display: block; border-radius: 4px; border: 1px solid #dbf1fe;\" width=\"80\">\n</td>\n<td style=\"padding-left: 20px;\" valign=\"top\" class=\"\">\n<p style=\"margin: 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 700; color: #071e27;\" class=\"\">${item.article.title}</p>\n<p style=\"margin: 4px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 13px; color: #414754;\" class=\"\">Menge: 1</p>\n<p style=\"margin: 4px 0 0 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 700; color: #071e27;\" class=\"\">\n\n${Intl.NumberFormat('en-US', { style: 'currency', currency: item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'currency').value, minimumFractionDigits: item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'decimalPlaces').value, maximumFractionDigits: item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'decimalPlaces').value }).format(item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'value').value / 10 ** item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'decimalPlaces').value)}\n\n</p>\n</td>\n</tr>\n</tbody></table>\n</td>\n</tr>\n`).join('') }}\n\n\n</td></tr><tr><td align=\"center\" style=\"padding-top: 8px; padding-bottom: 8px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td align=\"center\" style=\"border-radius: 50px; background-color: #2b5ab5;\">\n<a href=\"#\" style=\"font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 700; color: #ffffff; text-decoration: none; padding: 18px 48px; display: inline-block;\" target=\"_blank\">View Store Details</a>\n</td></tr></tbody></table>\n<p style=\"margin: 16px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 13px; font-style: italic; color: #414754;\">Bring a valid ID and your pickup code.</p>\n</td></tr>\n<tr><td style=\"padding-top: 80px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;border-top: 1px solid #dbf1fe;\"><tbody><tr>\n<td valign=\"top\" width=\"300\" style=\"width:300px;padding-top:40px;\">\n<p style=\"margin: 0px; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 20px; font-weight: 800; color: #071e27; letter-spacing: -0.02em;\">fulfillmenttools Shop</p>\n\n</td>\n<td valign=\"top\" width=\"150\" style=\"width:150px;padding-top:40px;\">\n<p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #071e27;\">Support</p>\n<p style=\"margin: 12px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px;\"><a href=\"#\" style=\"color: #414754; text-decoration: none;\">Help Center</a><br><a href=\"#\" style=\"color: #414754; text-decoration: none;\">Shipping Policy</a></p>\n</td>\n<td valign=\"top\" width=\"150\" style=\"width:150px;padding-top:40px;\">\n<p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #071e27;\">Contact</p>\n<p style=\"margin: 12px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px;\"><a href=\"mailto:shop@fulfillmenttools.com\" style=\"color: #414754; text-decoration: none;\">Concierge Email</a><br><a href=\"#\" style=\"color: #414754; text-decoration: none;\">Live Chat</a></p>\n</td></tr>\n<tr><td align=\"center\" colspan=\"3\" style=\"padding-top: 40px;\"><p style=\"margin: 0px; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 10px; color: #727785; text-transform: uppercase; letter-spacing: 0.1em;\">\u00a9 2023 FULFILLMENTTOOLS SHOP. ALL RIGHTS RESERVED.</p></td></tr>\n</tbody></table>\n</td></tr>\n</tbody></table>\n</td></tr></tbody></table>\n</body></html>",
        "options": {},
        "subject": "=Your Order {{ $('Handoverjob Created').item.json.payload.tenantOrderId }} at fulfillmenttools Shop is ready for pickup"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2e9a599f-dceb-4896-8b19-7ec19f79ceee",
      "name": "Send pickup email german",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1888,
        0
      ],
      "parameters": {
        "sendTo": "={{ $('Get Order by Id').item.json.consumer.addresses[0].email }}",
        "message": "=<!DOCTYPE html><html lang=\"de\" xmlns=\"http://www.w3.org/1999/xhtml\"><head>\n<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n<meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\">\n<title>Zur Abholung bereit | fulfillmenttools Shop</title>\n<link href=\"https://fonts.googleapis.com/css2?family=Manrope:wght@400;700;800&amp;family=Inter:wght@400;500;600&amp;display=swap\" rel=\"stylesheet\">\n<style type=\"text/css\">\nbody, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }\ntable, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }\nimg { -ms-interpolation-mode: bicubic; border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }\ntable { border-collapse: collapse !important; }\nbody { margin: 0 !important; padding: 0 !important; width: 100% !important; background-color: #f3faff; }\na[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; font-size: inherit !important; font-family: inherit !important; font-weight: inherit !important; line-height: inherit !important; }\n</style></head>\n<body style=\"margin: 0; padding: 0; background-color: #f3faff; font-family: 'Inter', Helvetica, Arial, sans-serif;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"background-color:#f3faff;\"><tbody><tr>\n<td align=\"center\" style=\"padding: 40px 10px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;\"><tbody>\n<tr><td align=\"left\" style=\"padding-bottom: 40px;\">\n<h1 style=\"margin: 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 32px; font-weight: 800; line-height: 40px; color: #071e27; letter-spacing: -0.02em;\">Bereit zur Abholung, {{ $('Get Order by Id').item.json.consumer.addresses[0].firstName }}!</h1>\n<p style=\"margin: 20px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; color: #414754;\">Ihre Click-&-Collect-Bestellung {{ $('Get Order by Id').item.json.tenantOrderId }} liegt in Ihrer gew\u00e4hlten Filiale bereit. Zeigen Sie Ihren Abholcode an der Theke vor.</p></td></tr><tr><td style=\"padding-bottom: 32px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px; background-color: #e6f6ff; border-radius: 8px;\"><tbody><tr>\n<td style=\"padding: 24px 28px; border-left: 4px solid #2b5ab5;\">\n<p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #727785;\">Abholstatus</p>\n<p style=\"margin: 8px 0 0 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 24px; font-weight: 800; color: #2b5ab5;\">Zur Abholung bereit</p>\n<p style=\"margin: 6px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 14px; color: #414754;\">Bitte bis zum 3. Nov. 2023 abholen</p>\n</td></tr></tbody></table></td></tr><tr><td style=\"padding-bottom: 32px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px; background-color: #ffffff; border-radius: 8px; border: 1px solid #dbf1fe;\"><tbody><tr><td style=\"padding: 24px;\">\n<p style=\"margin: 0 0 20px 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #727785;\">Abholort</p>\n<p style=\"margin: 0 0 4px 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px; color: #414754;\">Filiale</p><p style=\"margin: 0 0 20px 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 700; color: #071e27;\">{{ $('Get pickup Facility').item.json.name }}</p><p style=\"margin:0 0 20px 0;font-family:'Inter', Helvetica, Arial, sans-serif;font-size:14px;line-height:20px;color:#071e27;\">{{ $('Get pickup Facility').item.json.address.street }} {{ $('Get pickup Facility').item.json.address.houseNumber }}<br>{{ $('Get pickup Facility').item.json.address.postalCode }} {{ $('Get pickup Facility').item.json.address.city }}<br></p><p style=\"margin: 0 0 4px 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px; color: #414754;\">Abholcode</p><p style=\"margin: 0 0 20px 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 24px; font-weight: 800; color: #2b5ab5;\">4417</p>\n</td></tr></tbody></table></td></tr><tr><td style=\"padding-bottom: 32px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px; background-color: #ffffff; border: 1px solid #dbf1fe; border-radius: 8px;\"><tbody>\n<tr><td style=\"background-color: #cfe6f2; padding: 12px 24px;\"><p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #414754;\">RESERVIERTE ARTIKEL</p></td></tr>\n\n{{ $('Handoverjob Created').item.json.payload.handoverJobLineItems.map(item => `<tr>\n<td style=\"padding: 24px; border-bottom: 1px solid #dbf1fe;\" class=\"\">\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tbody><tr>\n<td valign=\"top\" width=\"80\">\n<img alt=\"${item.article.title}\" src=\"${item.article.imageUrl}\" style=\"display: block; border-radius: 4px; border: 1px solid #dbf1fe;\" width=\"80\">\n</td>\n<td style=\"padding-left: 20px;\" valign=\"top\" class=\"\">\n<p style=\"margin: 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 700; color: #071e27;\" class=\"\">${item.article.title}</p>\n<p style=\"margin: 4px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 13px; color: #414754;\" class=\"\">Menge: 1</p>\n<p style=\"margin: 4px 0 0 0; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 15px; font-weight: 700; color: #071e27;\" class=\"\">\n\n${Intl.NumberFormat('de-DE', { style: 'currency', currency: item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'currency').value, minimumFractionDigits: item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'decimalPlaces').value, maximumFractionDigits: item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'decimalPlaces').value }).format(item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'value').value / 10 ** item.article.attributes.find(item => item.category === 'finalUnitPrice' && item.key === 'decimalPlaces').value)}\n\n</p>\n</td>\n</tr>\n</tbody></table>\n</td>\n</tr>\n`).join('') }}\n\n\n</td></tr><tr><td align=\"center\" style=\"padding-top: 8px; padding-bottom: 8px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td align=\"center\" style=\"border-radius: 50px; background-color: #2b5ab5;\">\n<a href=\"#\" style=\"font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 700; color: #ffffff; text-decoration: none; padding: 18px 48px; display: inline-block;\" target=\"_blank\">Filialdetails ansehen</a>\n</td></tr></tbody></table>\n<p style=\"margin: 16px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 13px; font-style: italic; color: #414754;\">Bitte bringen Sie einen g\u00fcltigen Ausweis und Ihren Abholcode mit.</p>\n</td></tr>\n<tr><td style=\"padding-top: 80px;\">\n<table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"width:600px;border-top: 1px solid #dbf1fe;\"><tbody><tr>\n<td valign=\"top\" width=\"300\" style=\"width:300px;padding-top:40px;\">\n<p style=\"margin: 0px; font-family: 'Manrope', Helvetica, Arial, sans-serif; font-size: 20px; font-weight: 800; color: #071e27; letter-spacing: -0.02em;\">fulfillmenttools Shop</p>\n\n</td>\n<td valign=\"top\" width=\"150\" style=\"width:150px;padding-top:40px;\">\n<p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #071e27;\">HILFE</p>\n<p style=\"margin: 12px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px;\"><a href=\"#\" style=\"color: #414754; text-decoration: none;\">Hilfecenter</a><br><a href=\"#\" style=\"color: #414754; text-decoration: none;\">Versandbedingungen</a></p>\n</td>\n<td valign=\"top\" width=\"150\" style=\"width:150px;padding-top:40px;\">\n<p style=\"margin: 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #071e27;\">KONTAKT</p>\n<p style=\"margin: 12px 0 0 0; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 12px;\"><a href=\"mailto:shop@fulfillmenttools.com\" style=\"color: #414754; text-decoration: none;\">Concierge-E-Mail</a><br><a href=\"#\" style=\"color: #414754; text-decoration: none;\">Live-Chat</a></p>\n</td></tr>\n<tr><td align=\"center\" colspan=\"3\" style=\"padding-top: 40px;\"><p style=\"margin: 0px; font-family: 'Inter', Helvetica, Arial, sans-serif; font-size: 10px; color: #727785; text-transform: uppercase; letter-spacing: 0.1em;\">\u00a9 2023 FULFILLMENTTOOLS SHOP. ALLE RECHTE VORBEHALTEN.</p></td></tr>\n</tbody></table>\n</td></tr>\n</tbody></table>\n</td></tr></tbody></table>\n</body></html>",
        "options": {},
        "subject": "=Ihre Bestellung {{ $('Handoverjob Created').item.json.payload.tenantOrderId }} bei fulfillmenttools Shop wird geliefert"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "bb799361-ba00-4f7f-9d9b-1eb4110d0b9a",
      "name": "Get Order by tenantId",
      "type": "@fulfillmenttools/n8n-nodes-fulfillmenttools.fulfillmenttools",
      "position": [
        304,
        -80
      ],
      "parameters": {
        "filters": {
          "tenantOrderId": "={{ $('Handoverjob Created').item.json.payload.tenantOrderId }}"
        },
        "resource": "order",
        "operation": "getAll"
      },
      "credentials": {
        "fulfillmenttoolsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e81f9cc4-1df3-48a6-a897-59ec8f7a609e",
      "name": "Get Order by Id",
      "type": "@fulfillmenttools/n8n-nodes-fulfillmenttools.fulfillmenttools",
      "position": [
        480,
        -80
      ],
      "parameters": {
        "orderId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "resource": "order",
        "operation": "get"
      },
      "credentials": {
        "fulfillmenttoolsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b2a49f3c-c99b-4980-b558-5823e5914df1",
      "name": "Check for valid email address",
      "type": "n8n-nodes-base.if",
      "position": [
        672,
        -80
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "5f332a00-574c-477d-92f8-15ec19a515b4",
              "operator": {
                "type": "string",
                "operation": "exists",
                "singleValue": true
              },
              "leftValue": "={{ $json.consumer.addresses[0].email }}",
              "rightValue": ""
            },
            {
              "id": "fa21b2ac-9594-4cdd-939d-a48f52501fae",
              "operator": {
                "type": "string",
                "operation": "notEmpty",
                "singleValue": true
              },
              "leftValue": "={{ $json.consumer.addresses[0].email }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "96adf414-c229-4422-a726-f445062c7d84",
      "name": "Get pickup Facility",
      "type": "@fulfillmenttools/n8n-nodes-fulfillmenttools.fulfillmenttools",
      "position": [
        1136,
        -96
      ],
      "parameters": {
        "operation": "get",
        "facilityId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $('Handoverjob Created').item.json.payload.facilityRef }}"
        }
      },
      "credentials": {
        "fulfillmenttoolsApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b5e9e1e7-4949-4d8d-8fea-2f1db148d66d",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        -432
      ],
      "parameters": {
        "color": "#FFFF88",
        "width": 528,
        "height": 848,
        "content": "# Send an email to a customer when his Order in fulfillmenttools is ready for pickup\n## How it works\n1. **fulfillmenttools Trigger** finds every created Handoverjob\n2. Data gets **checked** if valid for an email notification\n3. Fetch the **original Order** from **fulfillmenttools**\n4. Check for a **valid email address**\n5 Fetch the **selected pickup Facility** for more data\n4. Through a switch the **Language** of the customer is determined\n5. The right email is send through **google Mail**\n\n## Setup\n- [ ] Install **fulfillmenttools** community node\n- [ ] Connect  **fulfillmenttools** to the **Trigger**, the **Get Order by tenantId**, the **Get Order by Id** and the **Get pickup Facility** Action\n- [ ] Add **API Base URL** to connection\n- [ ] Add **Auth key** to connection\n- [ ] Add **User** to connection\n- [ ] Add **Password** to connection\n- [ ] Connect **Gmail**  OAuth on both Gmail Nodes\n- [ ] Assure the needed customAttribute **shopLanguage** get send with the Order into fulfillmenttools\n\n## Customize\n- Change the gmail mail Layout to your CI\n- Add or change **Languages** in the **Switch**\n- Adjust the Data Check to your needs. For example change or delete the salesSource check"
      },
      "typeVersion": 1
    },
    {
      "id": "03cfd2c6-9e26-417c-ae1c-b72234144822",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -512,
        -224
      ],
      "parameters": {
        "color": "#D1D1D1",
        "width": 496,
        "height": 432,
        "content": "## Get and check Data\nThe fulfillmenttools Trigger will deliver all Handoverjobs that have been created and therefore are now ready for pickup for the Customer.\nThe Data check assures only valid Orders of type \"collect\" from a specific source get processed."
      },
      "typeVersion": 1
    },
    {
      "id": "48429852-4b29-4516-bd54-f0240f65f63c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        -304
      ],
      "parameters": {
        "color": "#D1D1D1",
        "width": 608,
        "height": 384,
        "content": "## Collect Order Data and check for email address\nThe Workflow fetches the original Order of this customer from fulfillmenttools. In this data the email address of the customer is saved and gets checked in the last step."
      },
      "typeVersion": 1
    },
    {
      "id": "d5490742-0358-4ecf-ae85-2a2c9c42ff92",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -336
      ],
      "parameters": {
        "color": "#D1D1D1",
        "width": 496,
        "height": 432,
        "content": "## Collect pickup Facility Data and check for Language\nTo have all the data needed for our email Template this step collects the selected pickup Facility for this Order and checks which language did the customer use inside our Shop. This way we can determine which Language the email should be"
      },
      "typeVersion": 1
    },
    {
      "id": "f615ed86-a4be-4b93-8a5f-437a6f71da06",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1696,
        -432
      ],
      "parameters": {
        "color": "#D1D1D1",
        "width": 496,
        "height": 624,
        "content": "## Send emails to Customer\nThe Workflow connects to gmail and sends the email in the correct language to the customer. Here a HTML message is used that relies on data from the Workflow, like the Trigger and the selected pickup Facility to personalize the message."
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "9f44d07f-4185-44cd-a342-54a87459ec50",
  "nodeGroups": [],
  "connections": {
    "Get Order by Id": {
      "main": [
        [
          {
            "node": "Check for valid email address",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Language": {
      "main": [
        [
          {
            "node": "Send pickup email english",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send pickup email german",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get pickup Facility": {
      "main": [
        [
          {
            "node": "Select Language",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Handoverjob Created": {
      "main": [
        [
          {
            "node": "Check If Data is Valid",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Order by tenantId": {
      "main": [
        [
          {
            "node": "Get Order by Id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Data is Valid": {
      "main": [
        [
          {
            "node": "Get Order by tenantId",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send pickup email german": {
      "main": [
        []
      ]
    },
    "Send pickup email english": {
      "main": [
        []
      ]
    },
    "Check for valid email address": {
      "main": [
        [
          {
            "node": "Get pickup Facility",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}