n8n-nodes-mailchimp-cmdesign 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -117,7 +117,7 @@ class MailchimpCmNode {
|
|
117
117
|
const apiKey = credentials.apiKey;
|
118
118
|
const response = await this.helpers.httpRequest({
|
119
119
|
method: 'GET',
|
120
|
-
url: `https://${server}.api.mailchimp.com/3.0/lists/${listId}/merge-fields?count=
|
120
|
+
url: `https://${server}.api.mailchimp.com/3.0/lists/${listId}/merge-fields?count=50&offset=0`,
|
121
121
|
headers: {
|
122
122
|
Authorization: `apikey ${apiKey}`,
|
123
123
|
},
|
@@ -6,7 +6,6 @@ async function createUpdateSubscriber(apiUrl, apiKey) {
|
|
6
6
|
var _a, _b;
|
7
7
|
const listId = this.getNodeParameter('listId', 0);
|
8
8
|
const email = this.getNodeParameter('email', 0);
|
9
|
-
const createIfNotExists = this.getNodeParameter('createIfNotExists', 0);
|
10
9
|
const mapping = this.getNodeParameter('subscriberFieldMapping', 0);
|
11
10
|
const mergeFields = {};
|
12
11
|
if (((_a = mapping === null || mapping === void 0 ? void 0 : mapping.subscriberFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
@@ -15,29 +14,25 @@ async function createUpdateSubscriber(apiUrl, apiKey) {
|
|
15
14
|
}
|
16
15
|
}
|
17
16
|
const body = {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
status: 'subscribed',
|
22
|
-
merge_fields: mergeFields,
|
23
|
-
},
|
24
|
-
],
|
25
|
-
update_existing: createIfNotExists,
|
17
|
+
email_address: email,
|
18
|
+
status: 'subscribed',
|
19
|
+
merge_fields: mergeFields,
|
26
20
|
};
|
27
21
|
try {
|
28
|
-
|
22
|
+
const response = await this.helpers.httpRequest({
|
29
23
|
method: 'POST',
|
30
|
-
url: `${apiUrl}/lists/${listId}`,
|
24
|
+
url: `${apiUrl}/lists/${listId}/members`,
|
31
25
|
headers: {
|
32
26
|
Authorization: `apikey ${apiKey}`,
|
33
27
|
},
|
34
28
|
body,
|
35
29
|
json: true,
|
36
30
|
});
|
31
|
+
return response;
|
37
32
|
}
|
38
33
|
catch (error) {
|
39
34
|
throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
|
40
|
-
message: 'Hiba történt az előfizető létrehozása
|
35
|
+
message: 'Hiba történt az előfizető létrehozása közben.',
|
41
36
|
});
|
42
37
|
}
|
43
38
|
}
|