diff --git a/website/api/controllers/deliver-contact-form-message.js b/website/api/controllers/deliver-contact-form-message.js index bf0a8030fd..0ccb3c0bc5 100644 --- a/website/api/controllers/deliver-contact-form-message.js +++ b/website/api/controllers/deliver-contact-form-message.js @@ -75,7 +75,7 @@ module.exports = { emailAddress: emailAddress, firstName: firstName, lastName: lastName, - leadSource: 'Website - Contact forms', + contactSource: 'Website - Contact forms', description: `Sent a contact form message: ${message}`, }).exec((err)=>{// Use .exec() to run the salesforce helpers in the background. if(err) { 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 6dd53f88be..af26395dc1 100644 --- a/website/api/controllers/deliver-talk-to-us-form-submission.js +++ b/website/api/controllers/deliver-talk-to-us-form-submission.js @@ -82,7 +82,7 @@ module.exports = { organization: organization, numberOfHosts: numberOfHosts, primaryBuyingSituation: primaryBuyingSituation === 'eo-security' ? 'Endpoint operations - Security' : primaryBuyingSituation === 'eo-it' ? 'Endpoint operations - IT' : primaryBuyingSituation === 'mdm' ? 'Device management (MDM)' : primaryBuyingSituation === 'vm' ? 'Vulnerability management' : undefined, - leadSource: 'Website - Contact forms', + contactSource: 'Website - Contact forms', leadDescription: `Submitted the "Talk to us" form and was taken to the Calendly page for the "Talk to us" event.`, }).exec((err)=>{ if(err) { @@ -96,7 +96,7 @@ module.exports = { lastName: lastName, organization: organization, primaryBuyingSituation: primaryBuyingSituation === 'eo-security' ? 'Endpoint operations - Security' : primaryBuyingSituation === 'eo-it' ? 'Endpoint operations - IT' : primaryBuyingSituation === 'mdm' ? 'Device management (MDM)' : primaryBuyingSituation === 'vm' ? 'Vulnerability management' : undefined, - leadSource: 'Website - Contact forms', + contactSource: 'Website - Contact forms', description: `Submitted the "Talk to us" form and was taken to the Calendly page for the "Let\'s get you set up!" event.`, }).exec((err)=>{ if(err) { diff --git a/website/api/controllers/entrance/signup.js b/website/api/controllers/entrance/signup.js index 8d723cbc46..c9129ac3c6 100644 --- a/website/api/controllers/entrance/signup.js +++ b/website/api/controllers/entrance/signup.js @@ -144,7 +144,7 @@ the account verification message.)`, firstName: firstName, lastName: lastName, organization: organization, - leadSource: 'Website - Sign up' + contactSource: 'Website - Sign up' }).exec((err)=>{ if(err){ sails.log.warn(`Background task failed: When a user (email: ${newEmailAddress} signed up for a fleetdm.com account, a Contact and Account record could not be created/updated in the CRM.`, err); diff --git a/website/api/controllers/save-questionnaire-progress.js b/website/api/controllers/save-questionnaire-progress.js index 4f7b3a2922..0eec64d1a4 100644 --- a/website/api/controllers/save-questionnaire-progress.js +++ b/website/api/controllers/save-questionnaire-progress.js @@ -221,7 +221,7 @@ module.exports = { primaryBuyingSituation: primaryBuyingSituation === 'eo-security' ? 'Endpoint operations - Security' : primaryBuyingSituation === 'eo-it' ? 'Endpoint operations - IT' : primaryBuyingSituation === 'mdm' ? 'Device management (MDM)' : primaryBuyingSituation === 'vm' ? 'Vulnerability management' : undefined, organization: this.req.me.organization, psychologicalStage, - leadSource: 'Website - Sign up', + contactSource: 'Website - Sign up', }).exec((err)=>{ if(err){ sails.log.warn(`Background task failed: When a user (email: ${this.req.me.emailAddress} submitted a step of the get started questionnaire, a Contact and Account record could not be created/updated in the CRM.`, err); diff --git a/website/api/helpers/salesforce/update-or-create-contact-and-account-and-create-lead.js b/website/api/helpers/salesforce/update-or-create-contact-and-account-and-create-lead.js index aa13206c48..980ffae8c0 100644 --- a/website/api/helpers/salesforce/update-or-create-contact-and-account-and-create-lead.js +++ b/website/api/helpers/salesforce/update-or-create-contact-and-account-and-create-lead.js @@ -35,7 +35,7 @@ module.exports = { type: 'string', description: 'A description of what this lead is about; e.g. a contact form message, or the size of t-shirt being requested.' }, - leadSource: { + contactSource: { type: 'string', required: true, isIn: [ @@ -58,7 +58,7 @@ module.exports = { - fn: async function ({emailAddress, linkedinUrl, firstName, lastName, organization, primaryBuyingSituation, psychologicalStage, leadSource, leadDescription, numberOfHosts}) { + fn: async function ({emailAddress, linkedinUrl, firstName, lastName, organization, primaryBuyingSituation, psychologicalStage, contactSource, leadDescription, numberOfHosts}) { if(sails.config.environment !== 'production') { sails.log('Skipping Salesforce integration...'); return; @@ -72,7 +72,7 @@ module.exports = { linkedinUrl, primaryBuyingSituation, psychologicalStage, - leadSource, + contactSource, description: leadDescription, }); @@ -80,7 +80,7 @@ module.exports = { salesforceContactId: recordIds.salesforceContactId, salesforceAccountId: recordIds.salesforceAccountId, leadDescription, - leadSource, + leadSource: contactSource, numberOfHosts, }); diff --git a/website/api/helpers/salesforce/update-or-create-contact-and-account.js b/website/api/helpers/salesforce/update-or-create-contact-and-account.js index aea76fd28c..8c483c83bb 100644 --- a/website/api/helpers/salesforce/update-or-create-contact-and-account.js +++ b/website/api/helpers/salesforce/update-or-create-contact-and-account.js @@ -30,7 +30,7 @@ module.exports = { '6 - Has team buy-in' ] }, - leadSource: { + contactSource: { type: 'string', isIn: [ 'Website - Contact forms', @@ -52,7 +52,7 @@ module.exports = { }, - fn: async function ({emailAddress, linkedinUrl, firstName, lastName, organization, primaryBuyingSituation, psychologicalStage, leadSource, description}) { + fn: async function ({emailAddress, linkedinUrl, firstName, lastName, organization, primaryBuyingSituation, psychologicalStage, contactSource, description}) { // Return undefined if we're not running in a production environment. if(sails.config.environment !== 'production') { sails.log.verbose('Skipping Salesforce integration...'); @@ -198,9 +198,9 @@ module.exports = { // console.log('New account created!', salesforceAccountId); }//fi - // Only add leadSource to valuesToSet if we're creating a new contact record. - if(leadSource) { - valuesToSet.LeadSource = leadSource; + // Only add contactSource to valuesToSet if we're creating a new contact record. + if(contactSource) { + valuesToSet.Contact_source__c = contactSource;// eslint-disable-line camelcase } // console.log(`creating new Contact record.`) // Create a new Contact record for this person.