From f743f6210c44408c70f7d6b95b0b969950f77b95 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 25 Nov 2025 17:57:10 -0600 Subject: [PATCH] Website: Update contact creation and enrichment in deliver-talk-to-us-form-submission (#36320) Related to: https://github.com/fleetdm/confidential/issues/13219 Changes: - Updated the `deliver-talk-to-us-form-submission` action to only use the email domain for contact creation and enrichment, and to include the provided organization name in contact descriptions. --- .../controllers/deliver-talk-to-us-form-submission.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/website/api/controllers/deliver-talk-to-us-form-submission.js b/website/api/controllers/deliver-talk-to-us-form-submission.js index 07ec1254bf..076b9977f1 100644 --- a/website/api/controllers/deliver-talk-to-us-form-submission.js +++ b/website/api/controllers/deliver-talk-to-us-form-submission.js @@ -83,7 +83,7 @@ module.exports = { emailAddress: emailAddress, firstName: firstName, lastName: lastName, - organization: organization, + // organization: organization, // Note: the user-provided organization is not used here because we're relying on the enrichment helper below to find the correct organization for this person. primaryBuyingSituation: primaryBuyingSituation === 'security-misc' ? 'Endpoint operations - Security' : primaryBuyingSituation === 'it-misc' ? 'Endpoint operations - IT' : primaryBuyingSituation === 'it-major-mdm' ? 'Device management (MDM)' : primaryBuyingSituation === 'it-gap-filler-mdm' ? 'IT - Gap-filler MDM' : primaryBuyingSituation === 'security-vm' ? 'Vulnerability management' : undefined, contactSource: 'Website - Contact forms', psychologicalStage: '4 - Has use case', @@ -92,7 +92,7 @@ module.exports = { // If the user said they have 700+ hosts, Update/create a contact and account, and send them to the "Talk to us" Calendly event. if(numberOfHosts >= 700){ - contactInformation.description = `Submitted the "Talk to us" form and was taken to the Calendly page for the "Talk to us" event. Number of hosts: ${numberOfHosts}`; + contactInformation.description = `Submitted the "Talk to us" form and was taken to the Calendly page for the "Talk to us" event. Provided organization name: ${organization}, Number of hosts: ${numberOfHosts}`; sails.helpers.salesforce.updateOrCreateContactAndAccount.with(contactInformation).exec((err)=>{ if(err) { sails.log.warn(`Background task failed: When a user submitted the "Talk to us" form, a lead/contact could not be updated in the CRM for this email address: ${emailAddress}.`, err); @@ -105,7 +105,6 @@ module.exports = { emailAddress, firstName, lastName, - organization, }).tolerate((err)=>{ sails.log.warn(`When a user (${emailAddress}) submitted the "Talk to us form", an error occured while getting enrichment information for this user. Error from get-enriched helper: ${require('util').inspect(err)}`); return {}; @@ -113,7 +112,7 @@ module.exports = { // If we got a employer.numberOfEmployees value from the getEnriched helper, send the user to the "talk to us" calendly event if it is 700+. if(enrichmentInformation.employer && enrichmentInformation.employer.numberOfEmployees && enrichmentInformation.employer.numberOfEmployees >= 700) { - contactInformation.description = `Submitted the "Talk to us" form and was taken to the Calendly page for the "Talk to us" event because of the number of employees (${enrichmentInformation.employer.numberOfEmployees}) returned by Coresignal. Number of hosts: ${numberOfHosts}`; + contactInformation.description = `Submitted the "Talk to us" form and was taken to the Calendly page for the "Talk to us" event because of the number of employees (${enrichmentInformation.employer.numberOfEmployees}) returned by Coresignal. Provided organization name: ${organization}, Number of hosts: ${numberOfHosts}`; sails.helpers.salesforce.updateOrCreateContactAndAccount.with(contactInformation).exec((err)=>{ if(err) { sails.log.warn(`Background task failed: When a user submitted the "Talk to us" form, a lead/contact could not be updated in the CRM for this email address: ${emailAddress}.`, err); @@ -122,14 +121,13 @@ module.exports = { return `https://calendly.com/fleetdm/talk-to-us?email=${encodeURIComponent(emailAddress)}&name=${encodeURIComponent(firstName+' '+lastName)}`; } else { // If the enrichment helper didn't return a employer.numberOfEmployees value and this user has <700 hosts, send them to the "Let's get you set up!" Calendly event - contactInformation.description = `Submitted the "Talk to us" form and was taken to the Calendly page for the "Let\'s get you set up!" event. Number of hosts: ${numberOfHosts}`; + contactInformation.description = `Submitted the "Talk to us" form and was taken to the Calendly page for the "Let\'s get you set up!" event. Provided organization name: ${organization}, Number of hosts: ${numberOfHosts}`; sails.helpers.salesforce.updateOrCreateContactAndAccount.with(contactInformation).exec((err)=>{ if(err) { sails.log.warn(`Background task failed: When a user submitted the "Talk to us" form, a lead/contact could not be updated in the CRM for this email address: ${emailAddress}.`, err); } }); return `https://calendly.com/fleetdm/chat?email=${encodeURIComponent(emailAddress)}&name=${encodeURIComponent(firstName+' '+lastName)}`; - // FUTURE: create POV here } } }