{"id":12728,"date":"2026-03-25T11:52:44","date_gmt":"2026-03-25T16:52:44","guid":{"rendered":"https:\/\/www.stage.commusoft.com\/?post_type=resource&#038;p=12728"},"modified":"2026-03-25T11:56:09","modified_gmt":"2026-03-25T16:56:09","slug":"test-booking-duplicate","status":"publish","type":"resource","link":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/","title":{"rendered":"TEST BOOKING (DUPLICATE)"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"335\" src=\"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp\" alt=\"Commusoft Job Costing Toolkit eBook cover featuring a professional in an office setting, titled &quot;Discover a simple way to measure and master your profit margins per job.&quot;\" class=\"wp-image-11404\" srcset=\"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp 600w, https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1-300x168.webp 300w, https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1-18x10.webp 18w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div id=\"form-wrapper-booking\">\n  <script src=\"https:\/\/js.hsforms.net\/forms\/embed\/developer\/530619.js\" defer><\/script>\n  <div class=\"hs-form-html\" data-region=\"na1\" data-form-id=\"6ad96d22-5798-482a-b00a-80dcb24269d4\" data-portal-id=\"530619\"><\/div>\n<\/div>\n<div id=\"calendar-wrapper-booking\" style=\"display:none; min-width:320px; height:750px;\"><\/div>\n<div id=\"thankyou-wrapper-booking\" style=\"display:none; padding:40px 20px; text-align:center;\">\n  <h2>Thank you for your submission!<\/h2>\n  <p>A member of our team will be in touch with you shortly.<\/p>\n<\/div>\n\n<script>\n  \/\/ -----------------------------------------------\n  \/\/ CONFIGURATION\n  \/\/ -----------------------------------------------\n  const CALENDAR_US = \"https:\/\/meetings.hubspot.com\/jack-sargent\/us-book-a-demo\";\n  const CALENDAR_UK = \"https:\/\/meetings.hubspot.com\/jack-sargent\/uk-book-a-demo\"; \/\/ \u2190 typo fixed\n\n  const US_CA_CODES = [\"+1\"];\n  const UK_CODES    = [\"+44\", \"+353\"];\n  \/\/ -----------------------------------------------\n\n  function getCalendarByPhone(phone) {\n    if (!phone) return null;\n    const cleaned = phone.replace(\/[\\s\\-().]\/g, \"\");\n    if (US_CA_CODES.some(code => cleaned.startsWith(code))) return CALENDAR_US;\n    if (UK_CODES.some(code => cleaned.startsWith(code)))    return CALENDAR_UK;\n    return null;\n  }\n\n  window.addEventListener(\"hs-form-event:on-submission:success\", async function(event) {\n    try {\n      const form     = HubSpotFormsV4.getFormFromEvent(event);\n      const formData = await form.getFormFieldValues();\n\n      \/\/ Safely scope to this specific form only\n      try {\n        const formElement = form.getFormElement();\n        if (formElement && !formElement.closest(\"#form-wrapper-booking\")) return;\n      } catch(e) {\n        \/\/ getFormElement not supported, skip scoping check\n      }\n\n      let userEmail     = \"\";\n      let userFirstName = \"\";\n      let userLastName  = \"\";\n      let userPhone     = \"\";\n      let userCompany   = \"\";\n\n      formData.forEach(function(field) {\n        if (field.name.includes(\"email\"))     userEmail     = field.value;\n        if (field.name.includes(\"firstname\")) userFirstName = field.value;\n        if (field.name.includes(\"lastname\"))  userLastName  = field.value;\n        if (field.name.includes(\"phone\"))     userPhone     = field.value;\n        if (field.name === \"0-2\/name\")        userCompany   = field.value;\n      });\n\n      \/\/ Debug \u2014 remove this line once working\n      console.log(\"Phone captured:\", userPhone);\n\n      \/\/ Hide this specific form\n      document.getElementById(\"form-wrapper-booking\").style.display = \"none\";\n\n      const baseCalendarUrl = getCalendarByPhone(userPhone);\n\n      if (baseCalendarUrl) {\n        const meetingUrl = baseCalendarUrl + \"?embed=true\"\n          + \"&firstName=\" + encodeURIComponent(userFirstName)\n          + \"&lastName=\"  + encodeURIComponent(userLastName)\n          + \"&email=\"     + encodeURIComponent(userEmail)\n          + \"&company=\"   + encodeURIComponent(userCompany);\n\n        const calWrapper = document.getElementById(\"calendar-wrapper-booking\");\n        calWrapper.style.display = \"block\";\n        calWrapper.innerHTML = '<iframe loading=\"lazy\" src=\"' + meetingUrl + '\" width=\"100%\" height=\"750px\" style=\"border:none;\"><\/iframe>';\n\n      } else {\n        document.getElementById(\"thankyou-wrapper-booking\").style.display = \"block\";\n      }\n\n    } catch (error) {\n      console.error(\"Could not fetch form values:\", error);\n    }\n  });\n<\/script>\n<\/div>\n<\/div>\n","protected":false},"featured_media":0,"template":"","meta":{"_acf_changed":false},"content-type":[],"industry-resource":[36],"class_list":["post-12728","resource","type-resource","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TEST BOOKING<\/title>\n<meta name=\"description\" content=\"Win more deals with our follow-up SMS and email templates. Designed for high-growth trade businesses to build technical authority and close proposals faster.\" \/>\n<meta name=\"robots\" content=\"noindex, nofollow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TEST BOOKING\" \/>\n<meta property=\"og:description\" content=\"Win more deals with our follow-up SMS and email templates. Designed for high-growth trade businesses to build technical authority and close proposals faster.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/\" \/>\n<meta property=\"og:site_name\" content=\"Commusoft\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/Commusoft\/\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-25T16:56:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"335\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@commusoft\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/\",\"url\":\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/\",\"name\":\"TEST BOOKING\",\"isPartOf\":{\"@id\":\"https:\/\/www.stage.commusoft.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp\",\"datePublished\":\"2026-03-25T16:52:44+00:00\",\"dateModified\":\"2026-03-25T16:56:09+00:00\",\"description\":\"Win more deals with our follow-up SMS and email templates. Designed for high-growth trade businesses to build technical authority and close proposals faster.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#primaryimage\",\"url\":\"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp\",\"contentUrl\":\"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stage.commusoft.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TEST BOOKING (DUPLICATE)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stage.commusoft.com\/#website\",\"url\":\"https:\/\/www.stage.commusoft.com\/\",\"name\":\"Commusoft\",\"description\":\"Field Service Management Software\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stage.commusoft.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TEST BOOKING","description":"Win more deals with our follow-up SMS and email templates. Designed for high-growth trade businesses to build technical authority and close proposals faster.","robots":{"index":"noindex","follow":"nofollow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"TEST BOOKING","og_description":"Win more deals with our follow-up SMS and email templates. Designed for high-growth trade businesses to build technical authority and close proposals faster.","og_url":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/","og_site_name":"Commusoft","article_publisher":"https:\/\/facebook.com\/Commusoft\/","article_modified_time":"2026-03-25T16:56:09+00:00","og_image":[{"width":600,"height":335,"url":"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_site":"@commusoft","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/","url":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/","name":"TEST BOOKING","isPartOf":{"@id":"https:\/\/www.stage.commusoft.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#primaryimage"},"image":{"@id":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#primaryimage"},"thumbnailUrl":"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp","datePublished":"2026-03-25T16:52:44+00:00","dateModified":"2026-03-25T16:56:09+00:00","description":"Win more deals with our follow-up SMS and email templates. Designed for high-growth trade businesses to build technical authority and close proposals faster.","breadcrumb":{"@id":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#primaryimage","url":"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp","contentUrl":"https:\/\/www.stage.commusoft.com\/wp-content\/uploads\/2026\/02\/Gemini_Generated_Image_q8ha5sq8ha5sq8ha-1.webp"},{"@type":"BreadcrumbList","@id":"https:\/\/www.stage.commusoft.com\/en-us\/resources\/test-booking-duplicate\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stage.commusoft.com\/"},{"@type":"ListItem","position":2,"name":"TEST BOOKING (DUPLICATE)"}]},{"@type":"WebSite","@id":"https:\/\/www.stage.commusoft.com\/#website","url":"https:\/\/www.stage.commusoft.com\/","name":"Commusoft","description":"Field Service Management Software","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stage.commusoft.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.stage.commusoft.com\/en-us\/wp-json\/wp\/v2\/resource\/12728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stage.commusoft.com\/en-us\/wp-json\/wp\/v2\/resource"}],"about":[{"href":"https:\/\/www.stage.commusoft.com\/en-us\/wp-json\/wp\/v2\/types\/resource"}],"wp:attachment":[{"href":"https:\/\/www.stage.commusoft.com\/en-us\/wp-json\/wp\/v2\/media?parent=12728"}],"wp:term":[{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/www.stage.commusoft.com\/en-us\/wp-json\/wp\/v2\/content-type?post=12728"},{"taxonomy":"industry-resource","embeddable":true,"href":"https:\/\/www.stage.commusoft.com\/en-us\/wp-json\/wp\/v2\/industry-resource?post=12728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}