Skip to content

Commit a99574b

Browse files
committed
Cleverreach - add zip to conditionally overwriten fields, activate users
1 parent 4d40001 commit a99574b

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

dist/crm/cleverreach/client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ const getContact = (email, token) => __awaiter(void 0, void 0, void 0, function*
6464
const data = yield response.json();
6565
// if there are values for quelle, name and lastname, we will use those values if they are empty in the message
6666
if (data === null || data === void 0 ? void 0 : data.global_attributes) {
67-
const { firstname, lastname, company, quelle } = data.global_attributes;
68-
return { firstname, lastname, company, quelle };
67+
const { firstname, lastname, company, quelle, zip } = data.global_attributes;
68+
return { firstname, lastname, company, quelle, zip };
6969
}
7070
return {};
7171
}

dist/crm/cleverreach/data.js

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const formatAction = (message, hasValues, customLabel) => {
2828
return ({
2929
"email": message.contact.email,
3030
"source": message.tracking.location || "",
31+
"activated": Math.floor(Date.now() / 1000),
3132
"attributes": attributes,
3233
"global_attributes": global
3334
});

src/crm/cleverreach/client.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export const getContact = async (email: string, token: string): Promise<any> =>
5757

5858
// if there are values for quelle, name and lastname, we will use those values if they are empty in the message
5959
if (data?.global_attributes) {
60-
const { firstname, lastname, company, quelle } = data.global_attributes;
61-
return { firstname, lastname, company, quelle };
60+
const { firstname, lastname, company, quelle, zip } = data.global_attributes;
61+
return { firstname, lastname, company, quelle, zip };
6262
}
6363
return {};
6464
} catch (error) {

src/crm/cleverreach/data.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ type Attributes = Record<'created_at', string>
55
type Contact = {
66
'email': string;
77
'source': string;
8+
"activated": number;
89
'attributes': Attributes
910
"global_attributes": ContactInfo;
1011
}
@@ -62,6 +63,7 @@ export const formatAction = (message: Message, hasValues: any, customLabel: stri
6263
{
6364
"email": message.contact.email,
6465
"source": message.tracking.location || "",
66+
"activated": Math.floor(Date.now() / 1000),
6567
"attributes": attributes,
6668
"global_attributes": global
6769
}

0 commit comments

Comments
 (0)