mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Website: Update signup.js (#17470)
Related to: https://github.com/fleetdm/confidential/issues/5695 Changes: - Updated `signup.js` to send a request to Zapier.
This commit is contained in:
parent
fdcf255d6c
commit
94cd621360
1 changed files with 20 additions and 0 deletions
20
website/api/controllers/entrance/signup.js
vendored
20
website/api/controllers/entrance/signup.js
vendored
|
|
@ -128,9 +128,29 @@ the account verification message.)`,
|
|||
.intercept({name: 'UsageError'}, 'invalid')
|
||||
.fetch();
|
||||
|
||||
// Send a POST request to Zapier
|
||||
await sails.helpers.http.post.with({
|
||||
url: 'https://hooks.zapier.com/hooks/catch/3627242/30bq2ib/',
|
||||
data: {
|
||||
newEmailAddress,
|
||||
firstName,
|
||||
lastName,
|
||||
organization,
|
||||
signupReason,
|
||||
webhookSecret: sails.config.custom.zapierSandboxWebhookSecret,
|
||||
}
|
||||
})
|
||||
.timeout(5000)
|
||||
.tolerate(['non200Response', 'requestFailed'], (err)=>{
|
||||
// Note that Zapier responds with a 2xx status code even if something goes wrong, so just because this message is not logged doesn't mean everything is hunky dory. More info: https://github.com/fleetdm/fleet/pull/6380#issuecomment-1204395762
|
||||
sails.log.warn(`When a user submitted a contact form message, a lead/contact could not be updated in the CRM for this email address: ${newEmailAddress}. Raw error: ${err}`);
|
||||
return;
|
||||
});
|
||||
|
||||
// Store the user's new id in their session.
|
||||
this.req.session.userId = newUserRecord.id;
|
||||
|
||||
|
||||
if (sails.config.custom.verifyEmailAddresses) {
|
||||
// Send "confirm account" email
|
||||
await sails.helpers.sendTemplateEmail.with({
|
||||
|
|
|
|||
Loading…
Reference in a new issue