From d58fcc66b2122600cc24befe5cd31255593a43c1 Mon Sep 17 00:00:00 2001 From: Gaines Murfee <35510173+GainesMurfee@users.noreply.github.com> Date: Thu, 19 May 2022 11:13:28 -0400 Subject: [PATCH] notes added to there code Will likely do a readme soon on this, but just adding some in-line comments in case customers or devs are looking at this to see how it works. --- HubSpot/Hubspot Chat/action.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HubSpot/Hubspot Chat/action.js b/HubSpot/Hubspot Chat/action.js index 255de28..bbad86d 100644 --- a/HubSpot/Hubspot Chat/action.js +++ b/HubSpot/Hubspot Chat/action.js @@ -1,6 +1,7 @@ const request = require("request"); exports.main = (event, callback) => { + //input your respective 'subdomain' and 'router-name' from your chili piper instance; "Concierge || Inbound Router" → "Javascript for your Inbound Concierge" const domain = "subdomain"; const router = "inbound-router"; @@ -17,6 +18,12 @@ exports.main = (event, callback) => { return; } +//in this request to the chili piper api, you will be submitting to us the "contact_email" value from Hubspot to the Chili Piper Marketing API +//at this point in time in the chat flow, the Hubspot chat will have created the Contact record in Hubspot +//thus Chili Piper will be able to lookup and retrieve the Contact fields and details from Hubspot, including any prior fields inputted prior in the chat +//that you may require for routing purposes, using the "contact_email" field as the key +//note: to ensure Chili Piper will be able to lookup and retrieve values in Hubspot, we recommend including at least 1 Queue +//in your respective "Concierge || Inbound Router" → "Scheduling Queues" with Algorithm = "Prioritize Routing based on Ownership", including Rules var options = { uri: "https://api.chilipiper.com/marketing/" + domain, method: "POST", @@ -33,6 +40,7 @@ exports.main = (event, callback) => { request(options, function (_, _, body) { const responseJson = { botMessage: body?.url + //you can change the hyperlink below from "Book a meeting!" to whatever you choose by editing the text below ? `Book a meeting!` : `Failed to book a meeting...`, responseExpected: false,