Skip to content

Commit

Permalink
Updated Intercom name field with firstName and lastName if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
arnab-p committed Jul 29, 2021
1 parent 3678920 commit 26be887
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integrations/INTERCOM/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ class INTERCOM {
}
}

// populate name if firstname and lastname is populated
// if name is not set
const { firstName, lastName, name } = context.traits;
if (!name && (firstName || lastName)) {
context.traits.name = `${firstName} ${lastName}`.trim();
}

// map rudderPayload to desired
Object.keys(context.traits).forEach((field) => {
if (context.traits.hasOwnProperty(field)) {
Expand Down

0 comments on commit 26be887

Please sign in to comment.