mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Website: update contacts when users subscribe to Fleet Premium (#22004)
Closes: #21921 Changes: - Updated `save-biling-info-and-subscribe` to update CRM records in the background when users purchase a self-service license.
This commit is contained in:
parent
cc8134af76
commit
c8149fa5e2
1 changed files with 16 additions and 0 deletions
|
|
@ -162,6 +162,22 @@ module.exports = {
|
|||
}
|
||||
});
|
||||
|
||||
let todayOn = new Date();
|
||||
let isoTimestampForDescription = todayOn.toISOString();
|
||||
sails.helpers.salesforce.updateOrCreateContactAndAccount.with({
|
||||
emailAddress: this.req.me.emailAddress,
|
||||
firstName: this.req.me.firstName,
|
||||
lastName: this.req.me.lastName,
|
||||
organization: this.req.me.organization,
|
||||
description: `Purchased a self-service Fleet Premium license on ${isoTimestampForDescription.split('T')[0]} for ${quoteRecord.numberOfHosts} host${quoteRecord.numberOfHosts > 1 ? 's' : ''}.`
|
||||
}).exec((err)=>{
|
||||
if(err){
|
||||
sails.log.warn(`Background task failed: When a user (email: ${this.req.me.emailAddress} purchased a self-service Fleet premium subscription, a Contact and Account record could not be created/updated in the CRM.`, err);
|
||||
}
|
||||
return;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue