n8n-nodes-mailchimp-cmdesign 0.2.7 → 0.3.0

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.
@@ -14,14 +14,19 @@ async function createUpdateSubscriber(apiUrl, apiKey) {
14
14
  }
15
15
  }
16
16
  const body = {
17
- email_address: email,
18
- status: 'subscribed',
19
- merge_fields: mergeFields,
17
+ members: [
18
+ {
19
+ email_address: email,
20
+ status: 'subscribed',
21
+ merge_fields: mergeFields,
22
+ },
23
+ ],
24
+ update_existing: true,
20
25
  };
21
26
  try {
22
27
  const response = await this.helpers.httpRequest({
23
- method: 'PUT',
24
- url: `${apiUrl}/lists/${listId}/members`,
28
+ method: 'POST',
29
+ url: `${apiUrl}/lists/${listId}`,
25
30
  headers: {
26
31
  Authorization: `apikey ${apiKey}`,
27
32
  },
@@ -32,7 +37,7 @@ async function createUpdateSubscriber(apiUrl, apiKey) {
32
37
  }
33
38
  catch (error) {
34
39
  throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
35
- message: 'Hiba történt az előfizető létrehozása közben.',
40
+ message: 'Hiba történt az előfizető létrehozása/frissítése közben.',
36
41
  });
37
42
  }
38
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-mailchimp-cmdesign",
3
- "version": "0.2.7",
3
+ "version": "0.3.0",
4
4
  "description": "n8n node to interact with Mailchimp API",
5
5
  "main": "index.js",
6
6
  "scripts": {