Website: Update zapier webhook request in signup action. (#18648)

Closes: #18643

Changes:
- Updated the response from the `updateOrCreateAccountAndContact` helper
when running the website in a development environment.
- Updated the Zapier webhook request in the signup action to send the
contact and account IDs returned from the
`updateOrCreateAccountAndContact` helper.
This commit is contained in:
Eric 2024-04-30 13:38:38 -05:00 committed by GitHub
parent 47362020ed
commit a9f79eacd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -139,7 +139,7 @@ the account verification message.)`,
.fetch();
await sails.helpers.salesforce.updateOrCreateContactAndAccount.with({
let recordIds = await sails.helpers.salesforce.updateOrCreateContactAndAccount.with({
emailAddress: newEmailAddress,
firstName: firstName,
lastName: lastName,
@ -155,6 +155,8 @@ the account verification message.)`,
lastName,
organization,
signupReason,
salesforceContactId: recordIds.salesforceContactId,
salesforceAccountId: recordIds.salesforceAccountId,
webhookSecret: sails.config.custom.zapierSandboxWebhookSecret,
}
})

View file

@ -47,7 +47,10 @@ module.exports = {
fn: async function ({emailAddress, linkedinUrl, firstName, lastName, organization, primaryBuyingSituation, psychologicalStage}) {
if(sails.config.environment !== 'production') {
sails.log.verbose('Skipping Salesforce integration...');
return;
return {
salesforceAccountId: undefined,
salesforceContactId: undefined
};
}
require('assert')(sails.config.custom.salesforceIntegrationUsername);