diff --git a/src/v0/destinations/braze/transform.js b/src/v0/destinations/braze/transform.js index 95290c925b..60f656a090 100644 --- a/src/v0/destinations/braze/transform.js +++ b/src/v0/destinations/braze/transform.js @@ -148,21 +148,6 @@ function getUserAttributesObject(message, mappingJson, destination) { return traits; } - // iterate over the destKeys and set the value if present - Object.keys(mappingJson).forEach((destKey) => { - let value = get(traits, mappingJson[destKey]); - if (value) { - // handle gender special case - if (destKey === 'gender') { - value = formatGender(value); - } - if (destKey === 'email') { - value = value.toLowerCase(); - } - data[destKey] = value; - } - }); - // reserved keys : already mapped through mappingJson const reservedKeys = [ 'address', @@ -185,6 +170,9 @@ function getUserAttributesObject(message, mappingJson, destination) { if (destKey === 'gender') { value = formatGender(value); } + if (destKey === 'email') { + value = value.toLowerCase(); + } data[destKey] = value; } }); diff --git a/src/v0/destinations/braze/util.js b/src/v0/destinations/braze/util.js index 4d47d6770b..8833923af8 100644 --- a/src/v0/destinations/braze/util.js +++ b/src/v0/destinations/braze/util.js @@ -131,7 +131,6 @@ const BrazeDedupUtility = { const externalIdentifiers = ids.filter((id) => id.external_id); const aliasIdentifiers = ids.filter((id) => id.alias_name !== undefined); - const startTime = Date.now(); const { processedResponse: lookUpResponse } = await handleHttpRequest( 'post', `${getEndpointFromConfig(destination)}/users/export/ids`, @@ -146,11 +145,6 @@ const BrazeDedupUtility = { timeout: 10 * 1000, }, ); - const endTime = Date.now(); - // TODO: Remove this log - console.log( - `Time taken to fetch user store: ${endTime - startTime} ms for ${ids.length} users`, - ); stats.counter('braze_lookup_failure_count', 1, { http_status: lookUpResponse.status }); const { users } = lookUpResponse.response;