Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
utsabc committed Mar 4, 2021
1 parent 66ee347 commit 377e34b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions integrations/Klaviyo/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ class Klaviyo {
$last_name: lastName,
$city: city,
$country: country,
$organization: get(message.context.traits, "organization"),
$title: get(message.context.traits, "title"),
$region: get(message.context.traits, "region"),
$zip: get(message.context.traits, "zip"),
$organization: get(message, "context.traits.organization"),
$title: get(message, "context.traits.title"),
$region: get(message, "context.traits.region"),
$zip: get(message, "context.traits.zip"),
};
if (!payload.$email && !payload.$phone_number && !payload.$id) {
logger.error("user id, phone or email not present");
Expand Down
36 changes: 18 additions & 18 deletions utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,32 +562,32 @@ function getDefinedTraits(message) {
const traitsValue = {
userId:
get(message, "userId") ||
get(message.context.traits, "userId") ||
get(message, "context.traits.userId") ||
get(message, "anonymousId"),
email:
get(message.context.traits, "email") ||
get(message.context.traits, "Email") ||
get(message.context.traits, "E-mail"),
get(message, "context.traits.email") ||
get(message, "context.traits.Email") ||
get(message, "context.traits.E-mail"),
phone:
get(message.context.traits, "phone") ||
get(message.context.traits, "Phone"),
get(message, "context.traits.phone") ||
get(message, "context.traits.Phone"),
firstName:
get(message.context.traits, "firstName") ||
get(message.context.traits, "firstname") ||
get(message.context.traits, "first_name"),
get(message, "context.traits.firstName") ||
get(message, "context.traits.firstname") ||
get(message, "context.traits.first_name"),
lastName:
get(message.context.traits, "lastName") ||
get(message.context.traits, "lastname") ||
get(message.context.traits, "last_name"),
get(message, "context.traits.lastName") ||
get(message, "context.traits.lastname") ||
get(message, "context.traits.last_name"),
name:
get(message.context.traits, "name") ||
get(message.context.traits, "Name"),
get(message, "context.traits.name") ||
get(message, "context.traits.Name"),
city:
get(message.context.traits, "city") ||
get(message.context.traits, "City"),
get(message, "context.traits.city") ||
get(message, "context.traits.City"),
country:
get(message.context.traits, "country") ||
get(message.context.traits, "Country"),
get(message, "context.traits.country") ||
get(message, "context.traits.Country"),
};
return traitsValue;
}
Expand Down

0 comments on commit 377e34b

Please sign in to comment.