Skip to content

Commit cb67262

Browse files
authored
fix: add alias support in case alias details are present (#3579)
1 parent 413e9ce commit cb67262

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/v0/destinations/braze/transform.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const {
3030
simpleProcessRouterDest,
3131
isNewStatusCodesAccepted,
3232
getDestinationExternalID,
33+
getIntegrationsObj,
3334
} = require('../../util');
3435
const {
3536
ConfigCategory,
@@ -498,10 +499,14 @@ async function process(event, processParams = { userStore: new Map() }, reqMetad
498499
if (mappedToDestination) {
499500
adduserIdFromExternalId(message);
500501
}
502+
503+
const integrationsObj = getIntegrationsObj(message, 'BRAZE');
504+
const isAliasPresent = isDefinedAndNotNull(integrationsObj?.alias);
505+
501506
const brazeExternalID =
502507
getDestinationExternalID(message, 'brazeExternalId') || message.userId;
503-
if (message.anonymousId && brazeExternalID) {
504-
await processIdentify(event);
508+
if ((message.anonymousId || isAliasPresent) && brazeExternalID) {
509+
await processIdentify({ message, destination });
505510
} else {
506511
collectStatsForAliasMissConfigurations(destination.ID);
507512
}

test/integrations/destinations/braze/processor/data.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4045,7 +4045,6 @@ export const data = [
40454045
Transformations: [],
40464046
},
40474047
message: {
4048-
anonymousId: 'e6ab2c5e-2cda-44a9-a962-e2f67df78bca',
40494048
channel: 'web',
40504049
context: {
40514050
traits: {

0 commit comments

Comments
 (0)