Website: Update receive-from-clay webhook. (#30153)

Closes: https://github.com/fleetdm/confidential/issues/11058

Changes:
- Updated the receive from clay webhook to log a warning and return a
`couldNotCreateActivity` response if it receives information about a
contact record with no account record associated with it.
This commit is contained in:
Eric 2025-06-19 12:44:57 -05:00 committed by GitHub
parent 7b3bc166bb
commit d7016b794c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -84,6 +84,11 @@ module.exports = {
}
});
if(!recordIds.salesforceAccountId) {
sails.log.warn(`When the receive-from-clay received information about a user's activity (name: ${firstName} ${lastName}), activity: ${intentSignal}). A contact was successfully updated, but the webhook is unable to continue because this contact is not associated with any Salesforce account record. Contact ID: ${recordIds.salesforceContactId}`);
throw 'couldNotCreateActivity';
}
let trimmedLinkedinUrl = linkedinUrl.replace(sails.config.custom.RX_PROTOCOL_AND_COMMON_SUBDOMAINS, '');
// Create the new Fleet website page view record.