Skip to content

Commit 2e932d6

Browse files
making company magic a separate setting field (#3181)
1 parent 8b9980c commit 2e932d6

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

packages/destination-actions/src/destinations/epsilon/generated-types.ts

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/destination-actions/src/destinations/epsilon/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ const destination: DestinationDefinition<Settings> = {
1717
description: 'Your Company ID. Contact Epsilon support for assistance.',
1818
type: 'string',
1919
required: true
20+
},
21+
dtm_cmagic: {
22+
label: 'Company Magic',
23+
description: 'Company Magic. Contact Epsilon support for assistance.',
24+
type: 'string',
25+
required: true
2026
}
2127
}
2228
},

packages/destination-actions/src/destinations/epsilon/sendEvent/__tests__/__snapshots__/snapshot.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Object {
1010
"dtm_event": "subcategory",
1111
"eventData": Object {
1212
"dtm_cid": "q05uljg*(jGG",
13-
"dtm_cmagic": "80f256",
13+
"dtm_cmagic": "q05uljg*(jGG",
1414
"dtm_email_hash": "2c3c44d1707148b8f84fd598e4eedd8c07c9fda884627048282510b958f48d68",
1515
"dtm_fid": "q05uljg*(jGG",
1616
"dtm_mobile_hash": "2c3c44d1707148b8f84fd598e4eedd8c07c9fda884627048282510b958f48d68",
@@ -37,7 +37,7 @@ Object {
3737
"dtm_event": "subcategory",
3838
"eventData": Object {
3939
"dtm_cid": "q05uljg*(jGG",
40-
"dtm_cmagic": "80f256",
40+
"dtm_cmagic": "q05uljg*(jGG",
4141
"dtm_fid": "q05uljg*(jGG",
4242
"dtm_promo_id": "q05uljg*(jGG",
4343
"dtmc_tms": 9,

packages/destination-actions/src/destinations/epsilon/sendEvent/__tests__/index.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { Settings } from '../../generated-types'
55

66
let testDestination = createTestIntegration(Definition)
77
const settings: Settings = {
8-
dtm_cid: 'test_cid'
8+
dtm_cid: 'test_cid',
9+
dtm_cmagic: 'test_cmagic'
910
}
1011

1112
const domain = 'https://login.dotomi.com'
@@ -123,7 +124,7 @@ describe('Epsilon.send', () => {
123124
eventData: {
124125
dtmc_tms: 9,
125126
dtm_cid: 'test_cid',
126-
dtm_cmagic: 'c4b91e',
127+
dtm_cmagic: 'test_cmagic',
127128
dtm_fid: 'test_fid',
128129
dtm_promo_id: 'test_promo_id',
129130
idfa: 'advertising_id_1',
@@ -173,7 +174,7 @@ describe('Epsilon.send', () => {
173174
eventData: {
174175
dtmc_tms: 9,
175176
dtm_cid: 'test_cid',
176-
dtm_cmagic: 'c4b91e',
177+
dtm_cmagic: 'test_cmagic',
177178
dtm_fid: 'test_fid',
178179
dtm_promo_id: 'test_promo_id',
179180
idfa: 'advertising_id_1',
@@ -224,7 +225,7 @@ describe('Epsilon.send', () => {
224225
eventData: {
225226
dtmc_tms: 9,
226227
dtm_cid: 'test_cid',
227-
dtm_cmagic: 'c4b91e',
228+
dtm_cmagic: 'test_cmagic',
228229
dtm_fid: 'test_fid',
229230
dtm_promo_id: 'test_promo_id',
230231
idfa: 'advertising_id_1',
@@ -281,7 +282,7 @@ describe('Epsilon.send', () => {
281282
eventData: {
282283
dtmc_tms: 9,
283284
dtm_cid: 'test_cid',
284-
dtm_cmagic: 'c4b91e',
285+
dtm_cmagic: 'test_cmagic',
285286
dtm_fid: 'test_fid',
286287
dtm_promo_id: 'test_promo_id',
287288
idfa: 'advertising_id_1',
@@ -358,7 +359,7 @@ describe('Epsilon.send', () => {
358359
eventData: {
359360
dtmc_tms: 9,
360361
dtm_cid: 'test_cid',
361-
dtm_cmagic: 'c4b91e',
362+
dtm_cmagic: 'test_cmagic',
362363
dtm_fid: 'test_fid',
363364
dtm_promo_id: 'test_promo_id',
364365
google_play_id: 'advertising_id_1',

packages/destination-actions/src/destinations/epsilon/sendEvent/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ const action: ActionDefinition<Settings, Payload> = {
7777
} = {}
7878
} = payload
7979

80-
const { dtm_cid } = settings
80+
const { dtm_cid, dtm_cmagic } = settings
8181

8282
let eventData: BaseEventData | NonTransactionEventData | TransactionEventData = {
8383
dtmc_tms: 9,
8484
dtm_cid: dtm_cid.trim(),
85-
dtm_cmagic: processHashing(dtm_cid, 'md5', 'hex', (value: string) => value?.trim()).substring(0, 6),
85+
dtm_cmagic,
8686
dtm_fid,
8787
dtm_promo_id,
8888
idfa: deviceType === 'ios' ? advertisingId : undefined,

0 commit comments

Comments
 (0)