n8n-nodes-novinmarketing 0.3.1 → 0.3.3
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.
- package/dist/nodes/{SendSmsBatch/SendSmsBatch.node.d.ts → CallCenter/CallCenter.node.d.ts} +1 -1
- package/dist/nodes/{SendToCallCenter/SendToCallCenter.node.js → CallCenter/CallCenter.node.js} +87 -43
- package/dist/nodes/CallCenter/CallCenter.node.js.map +1 -0
- package/dist/nodes/{SendSmsBatch/SendSmsBatch.node.json → CallCenter/CallCenter.node.json} +1 -1
- package/dist/nodes/GetSegmentUsers/GetSegmentUsers.node.js.map +1 -1
- package/dist/nodes/SendEmail/SendEmail.node.d.ts +2 -1
- package/dist/nodes/SendEmail/SendEmail.node.js +139 -56
- package/dist/nodes/SendEmail/SendEmail.node.js.map +1 -1
- package/dist/nodes/SendEmail/SendEmail.node.json +2 -2
- package/dist/nodes/SendEmail/SendEmail.svg +33 -42
- package/dist/nodes/SendSms/SendSms.node.d.ts +2 -1
- package/dist/nodes/SendSms/SendSms.node.js +137 -32
- package/dist/nodes/SendSms/SendSms.node.js.map +1 -1
- package/dist/nodes/SendSms/SendSms.node.json +2 -2
- package/dist/nodes/SendSms/SendSms.svg +2 -28
- package/dist/package.json +2 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -4
- package/dist/nodes/SendEmailBatch/SendEmail.svg +0 -33
- package/dist/nodes/SendEmailBatch/SendEmailBatch.node.d.ts +0 -5
- package/dist/nodes/SendEmailBatch/SendEmailBatch.node.js +0 -261
- package/dist/nodes/SendEmailBatch/SendEmailBatch.node.js.map +0 -1
- package/dist/nodes/SendEmailBatch/SendEmailBatch.node.json +0 -20
- package/dist/nodes/SendSmsBatch/SendSms.svg +0 -2
- package/dist/nodes/SendSmsBatch/SendSmsBatch.node.js +0 -221
- package/dist/nodes/SendSmsBatch/SendSmsBatch.node.js.map +0 -1
- package/dist/nodes/SendToCallCenter/SendToCallCenter.node.d.ts +0 -5
- package/dist/nodes/SendToCallCenter/SendToCallCenter.node.js.map +0 -1
- package/dist/nodes/SendToCallCenter/SendToCallCenter.node.json +0 -20
- /package/dist/nodes/{SendToCallCenter/SendToCallCenter.svg → CallCenter/CallCenter.svg} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class CallCenter implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
4
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
5
|
}
|
package/dist/nodes/{SendToCallCenter/SendToCallCenter.node.js → CallCenter/CallCenter.node.js}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
class
|
|
3
|
+
exports.CallCenter = void 0;
|
|
4
|
+
class CallCenter {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.description = {
|
|
7
|
-
displayName: 'Novin
|
|
8
|
-
name: '
|
|
9
|
-
icon: 'file:
|
|
7
|
+
displayName: 'Novin Call Center',
|
|
8
|
+
name: 'callCenter',
|
|
9
|
+
icon: 'file:CallCenter.svg',
|
|
10
10
|
group: ['transform'],
|
|
11
|
-
version: [
|
|
11
|
+
version: [1],
|
|
12
12
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
13
|
-
description: '
|
|
13
|
+
description: 'Call Center Node',
|
|
14
14
|
defaults: {
|
|
15
|
-
name: 'Novin
|
|
15
|
+
name: 'Novin Call Center',
|
|
16
16
|
},
|
|
17
17
|
inputs: ['main'],
|
|
18
18
|
outputs: ['main'],
|
|
@@ -40,6 +40,10 @@ class SendToCallCenter {
|
|
|
40
40
|
name: 'Send To Call Center',
|
|
41
41
|
value: 'NovinSendToCallCenter',
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
name: 'Delete From Call Center',
|
|
45
|
+
value: 'NovinDeleteFromCallCenter',
|
|
46
|
+
},
|
|
43
47
|
],
|
|
44
48
|
default: 'NovinSendToCallCenter',
|
|
45
49
|
},
|
|
@@ -72,14 +76,42 @@ class SendToCallCenter {
|
|
|
72
76
|
default: 'post',
|
|
73
77
|
},
|
|
74
78
|
{
|
|
75
|
-
displayName: '
|
|
76
|
-
name: '
|
|
79
|
+
displayName: 'Operation',
|
|
80
|
+
name: 'operation',
|
|
81
|
+
type: 'options',
|
|
82
|
+
noDataExpression: true,
|
|
83
|
+
displayOptions: {
|
|
84
|
+
show: {
|
|
85
|
+
resource: [
|
|
86
|
+
'NovinDeleteFromCallCenter',
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
options: [
|
|
91
|
+
{
|
|
92
|
+
name: 'Post',
|
|
93
|
+
value: 'post',
|
|
94
|
+
action: 'Delete from call center',
|
|
95
|
+
routing: {
|
|
96
|
+
request: {
|
|
97
|
+
method: 'POST',
|
|
98
|
+
url: '/users/deleteFromCallCenter',
|
|
99
|
+
body: '={{ { userIds: $json["userIds"] } }}',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
default: 'post',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Users',
|
|
108
|
+
name: 'users',
|
|
77
109
|
type: 'string',
|
|
78
|
-
default: '{{ $(
|
|
79
|
-
placeholder: '
|
|
110
|
+
default: '{{ $(previousNodename).all() }}',
|
|
111
|
+
placeholder: 'users _id',
|
|
80
112
|
routing: {
|
|
81
113
|
send: {
|
|
82
|
-
property: '
|
|
114
|
+
property: 'users',
|
|
83
115
|
type: 'body',
|
|
84
116
|
},
|
|
85
117
|
},
|
|
@@ -111,40 +143,53 @@ class SendToCallCenter {
|
|
|
111
143
|
},
|
|
112
144
|
},
|
|
113
145
|
},
|
|
146
|
+
{
|
|
147
|
+
displayName: 'Batch Size',
|
|
148
|
+
name: 'batchSize',
|
|
149
|
+
type: 'number',
|
|
150
|
+
default: 50,
|
|
151
|
+
description: 'Number of messages to accumulate before sending a batch',
|
|
152
|
+
},
|
|
114
153
|
],
|
|
115
154
|
};
|
|
116
155
|
}
|
|
117
156
|
async execute() {
|
|
118
|
-
const users = this.getNodeParameter('
|
|
157
|
+
const users = this.getNodeParameter('users', 0);
|
|
119
158
|
const callCenterCategory = this.getNodeParameter('callCenterCategory', 0);
|
|
159
|
+
const batchSize = this.getNodeParameter('batchSize', 0);
|
|
120
160
|
const sendCartItems = this.getNodeParameter('sendCartItems', 0);
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
-
|
|
161
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
162
|
+
const responseData = [];
|
|
163
|
+
let usersId = [];
|
|
124
164
|
for (let i = 0; i < users.length; i += batchSize) {
|
|
125
165
|
const batchUsers = users.slice(i, i + batchSize);
|
|
126
|
-
let userIds = [];
|
|
127
166
|
for (const user of batchUsers) {
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
userIds.push(user.json.body._id);
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
console.log('Invalid user format:', user);
|
|
137
|
-
}
|
|
167
|
+
if ('_id' in user.json) {
|
|
168
|
+
usersId.push({ userId: user.json._id });
|
|
169
|
+
}
|
|
170
|
+
else if ('body' in user.json && '_id' in user.json.body) {
|
|
171
|
+
usersId.push({ userId: user.json.body._id });
|
|
138
172
|
}
|
|
139
173
|
else {
|
|
140
|
-
console.log('
|
|
174
|
+
console.log('Invalid user format');
|
|
141
175
|
}
|
|
142
176
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
177
|
+
let requestBody;
|
|
178
|
+
let apiUrl;
|
|
179
|
+
if (resource === 'NovinSendToCallCenter') {
|
|
180
|
+
apiUrl = 'https://cdp.novin.marketing/api/users/sendToCallCenter';
|
|
181
|
+
requestBody = {
|
|
182
|
+
userIds: usersId,
|
|
183
|
+
callCenterCategory: callCenterCategory,
|
|
184
|
+
sendCartItems: sendCartItems,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
apiUrl = 'https://cdp.novin.marketing/api/users/deleteFromCallCenter';
|
|
189
|
+
requestBody = {
|
|
190
|
+
userIds: usersId
|
|
191
|
+
};
|
|
192
|
+
}
|
|
148
193
|
const options = {
|
|
149
194
|
method: 'POST',
|
|
150
195
|
url: apiUrl,
|
|
@@ -155,17 +200,16 @@ class SendToCallCenter {
|
|
|
155
200
|
},
|
|
156
201
|
json: true,
|
|
157
202
|
};
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
203
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'novinMarketingApi', options);
|
|
204
|
+
if (Array.isArray(response)) {
|
|
205
|
+
responseData.push(...response);
|
|
161
206
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
throw error;
|
|
207
|
+
else {
|
|
208
|
+
responseData.push(response);
|
|
165
209
|
}
|
|
166
210
|
}
|
|
167
|
-
return
|
|
211
|
+
return [this.helpers.returnJsonArray(responseData)];
|
|
168
212
|
}
|
|
169
213
|
}
|
|
170
|
-
exports.
|
|
171
|
-
//# sourceMappingURL=
|
|
214
|
+
exports.CallCenter = CallCenter;
|
|
215
|
+
//# sourceMappingURL=CallCenter.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CallCenter.node.js","sourceRoot":"","sources":["../../../nodes/CallCenter/CallCenter.node.ts"],"names":[],"mappings":";;;AASA,MAAa,UAAU;IAAvB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAA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CAAC,GAAG,EAAE,CAAC,CAAC;iBAC7C;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;iBACnC;aACD;YACD,IAAI,WAAW,CAAC;YAChB,IAAI,MAAM,CAAC;YACX,IAAI,QAAQ,KAAK,uBAAuB,EAAE;gBACzC,MAAM,GAAG,wDAAwD,CAAC;gBAClE,WAAW,GAAG;oBACb,OAAO,EAAE,OAAO;oBAChB,kBAAkB,EAAE,kBAAkB;oBACtC,aAAa,EAAE,aAAa;iBAC5B,CAAC;aACF;iBACI;gBACJ,MAAM,GAAG,4DAA4D,CAAC;gBACtE,WAAW,GAAG;oBACb,OAAO,EAAE,OAAO;iBAChB,CAAC;aACF;YAGD,MAAM,OAAO,GAAwB;gBACpC,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,MAAM;gBACX,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE;oBACR,QAAQ,EAAE,kBAAkB;oBAC5B,cAAc,EAAE,kBAAkB;iBAClC;gBACD,IAAI,EAAE,IAAI;aACV,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,IAAI,CACrE,IAAI,EACJ,mBAAmB,EACnB,OAAO,CACP,CAAC;YACF,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAC5B,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;aAC/B;iBAAM;gBACN,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAC5B;SACD;QACD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;IACrD,CAAC;CACD;AApND,gCAoNC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetSegmentUsers.node.js","sourceRoot":"","sources":["../../../nodes/GetSegmentUsers/GetSegmentUsers.node.ts"],"names":[],"mappings":";;;AACA,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACf,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,+BAA+B;aACrC;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,mBAAmB;oBACzB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,iCAAiC;
|
|
1
|
+
{"version":3,"file":"GetSegmentUsers.node.js","sourceRoot":"","sources":["../../../nodes/GetSegmentUsers/GetSegmentUsers.node.ts"],"names":[],"mappings":";;;AACA,MAAa,eAAe;IAA5B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACf,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,+BAA+B;aACrC;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,mBAAmB;oBACzB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,iCAAiC;gBAG1C,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YACD,UAAU,EAAE;gBAEX;oBACC,WAAW,EAAE,YAAY;oBACzB,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,IAAI;oBACb,WAAW,EAAE,oBAAoB;iBACjC;gBACD;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,MAAM;4BACb,MAAM,EAAE,wBAAwB;4BAChC,WAAW,EAAE,iDAAiD;4BAC9D,OAAO,EAAE;gCACR,OAAO,EAAE;oCACR,MAAM,EAAE,MAAM;oCACd,GAAG,EAAE,wBAAwB;oCAC7B,IAAI,EAAE,2CAA2C;iCACjD;6BACD;yBACD;qBACD;oBACD,OAAO,EAAE,MAAM;iBACf;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA9DD,0CA8DC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
1
|
+
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
2
|
export declare class SendEmail implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
4
5
|
}
|
|
@@ -8,7 +8,7 @@ class SendEmail {
|
|
|
8
8
|
name: 'sendEmail',
|
|
9
9
|
icon: 'file:SendEmail.svg',
|
|
10
10
|
group: ['transform'],
|
|
11
|
-
version: [2, 3
|
|
11
|
+
version: [1, 2, 3],
|
|
12
12
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
13
13
|
description: 'Node to Send Email',
|
|
14
14
|
defaults: {
|
|
@@ -31,60 +31,14 @@ class SendEmail {
|
|
|
31
31
|
},
|
|
32
32
|
properties: [
|
|
33
33
|
{
|
|
34
|
-
displayName: '
|
|
35
|
-
name: '
|
|
36
|
-
type: 'options',
|
|
37
|
-
noDataExpression: true,
|
|
38
|
-
options: [
|
|
39
|
-
{
|
|
40
|
-
name: 'Send Email',
|
|
41
|
-
value: 'NovinSendEmail',
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
default: 'NovinSendEmail',
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
displayName: 'Operation',
|
|
48
|
-
name: 'operation',
|
|
49
|
-
type: 'options',
|
|
50
|
-
noDataExpression: true,
|
|
51
|
-
displayOptions: {
|
|
52
|
-
show: {
|
|
53
|
-
resource: [
|
|
54
|
-
'NovinSendEmail',
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
options: [
|
|
59
|
-
{
|
|
60
|
-
name: 'Post',
|
|
61
|
-
value: 'post',
|
|
62
|
-
action: 'Send email',
|
|
63
|
-
description: 'Send Email',
|
|
64
|
-
routing: {
|
|
65
|
-
request: {
|
|
66
|
-
method: 'POST',
|
|
67
|
-
url: '/users/sendEmail2',
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
default: 'post',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
displayName: 'User ID',
|
|
76
|
-
displayOptions: {
|
|
77
|
-
show: {
|
|
78
|
-
'@version': [4],
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
name: 'userId',
|
|
34
|
+
displayName: 'Users',
|
|
35
|
+
name: 'users',
|
|
82
36
|
type: 'string',
|
|
83
|
-
default: '',
|
|
84
|
-
placeholder: '
|
|
37
|
+
default: '{{ $(previousNodename).all() }}',
|
|
38
|
+
placeholder: 'users List',
|
|
85
39
|
routing: {
|
|
86
40
|
send: {
|
|
87
|
-
property: '
|
|
41
|
+
property: 'users',
|
|
88
42
|
type: 'body',
|
|
89
43
|
},
|
|
90
44
|
},
|
|
@@ -106,7 +60,7 @@ class SendEmail {
|
|
|
106
60
|
displayName: 'Sender Name',
|
|
107
61
|
name: 'senderName',
|
|
108
62
|
type: 'string',
|
|
109
|
-
default: '',
|
|
63
|
+
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
110
64
|
placeholder: 'Enter Sender Name',
|
|
111
65
|
description: 'Sender Name of the email',
|
|
112
66
|
routing: {
|
|
@@ -120,7 +74,7 @@ class SendEmail {
|
|
|
120
74
|
displayName: 'Subject',
|
|
121
75
|
name: 'subject',
|
|
122
76
|
type: 'string',
|
|
123
|
-
default: '',
|
|
77
|
+
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
124
78
|
placeholder: 'Enter Subject',
|
|
125
79
|
description: 'Subject of the email',
|
|
126
80
|
routing: {
|
|
@@ -134,7 +88,7 @@ class SendEmail {
|
|
|
134
88
|
displayName: 'Preview',
|
|
135
89
|
name: 'preview',
|
|
136
90
|
type: 'string',
|
|
137
|
-
default: '',
|
|
91
|
+
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
138
92
|
placeholder: 'Enter Preview',
|
|
139
93
|
description: 'Preview of the email',
|
|
140
94
|
routing: {
|
|
@@ -148,7 +102,7 @@ class SendEmail {
|
|
|
148
102
|
displayName: 'Email Content',
|
|
149
103
|
name: 'content',
|
|
150
104
|
type: 'string',
|
|
151
|
-
default: '',
|
|
105
|
+
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
152
106
|
placeholder: 'Enter Email content',
|
|
153
107
|
description: 'Content to send',
|
|
154
108
|
routing: {
|
|
@@ -171,9 +125,138 @@ class SendEmail {
|
|
|
171
125
|
},
|
|
172
126
|
},
|
|
173
127
|
},
|
|
128
|
+
{
|
|
129
|
+
displayName: 'Dont Disturb',
|
|
130
|
+
name: 'dontDisturb',
|
|
131
|
+
type: 'boolean',
|
|
132
|
+
default: true,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Batch Size',
|
|
136
|
+
name: 'batchSize',
|
|
137
|
+
type: 'number',
|
|
138
|
+
default: 100,
|
|
139
|
+
description: 'Number of messages to accumulate before sending a batch',
|
|
140
|
+
},
|
|
174
141
|
],
|
|
175
142
|
};
|
|
176
143
|
}
|
|
144
|
+
async execute() {
|
|
145
|
+
const users = this.getNodeParameter('users', 0);
|
|
146
|
+
const dontDisturb = this.getNodeParameter('dontDisturb', 0);
|
|
147
|
+
const oncePerEmail = this.getNodeParameter('oncePerEmail', 0);
|
|
148
|
+
const parameters = this.getNode().parameters;
|
|
149
|
+
let textTemplate = parameters.content;
|
|
150
|
+
if (textTemplate.startsWith('=')) {
|
|
151
|
+
textTemplate = textTemplate.substring(1);
|
|
152
|
+
}
|
|
153
|
+
let preview = parameters.preview;
|
|
154
|
+
if (preview.startsWith('=')) {
|
|
155
|
+
preview = preview.substring(1);
|
|
156
|
+
}
|
|
157
|
+
let subject = parameters.subject;
|
|
158
|
+
if (subject.startsWith('=')) {
|
|
159
|
+
subject = subject.substring(1);
|
|
160
|
+
}
|
|
161
|
+
const senderName = this.getNodeParameter('senderName', 0);
|
|
162
|
+
const emailName = this.getNodeParameter('emailName', 0);
|
|
163
|
+
const batchSize = this.getNodeParameter('batchSize', 0);
|
|
164
|
+
if (dontDisturb) {
|
|
165
|
+
const currentTime = new Date();
|
|
166
|
+
const currentHour = currentTime.getHours();
|
|
167
|
+
if (currentHour >= 22 || currentHour < 9) {
|
|
168
|
+
let waitTime = 0;
|
|
169
|
+
if (currentHour >= 22) {
|
|
170
|
+
waitTime = (24 - currentHour + 9) * 60 * 60 * 1000 - currentTime.getMinutes() * 60 * 1000 - currentTime.getSeconds() * 1000 - currentTime.getMilliseconds();
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
waitTime = (9 - currentHour) * 60 * 60 * 1000 - currentTime.getMinutes() * 60 * 1000 - currentTime.getSeconds() * 1000 - currentTime.getMilliseconds();
|
|
174
|
+
}
|
|
175
|
+
await new Promise(resolve => setTimeout(resolve, waitTime));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const apiUrl = 'https://cdp.novin.marketing/api/users/sendEmailBatch';
|
|
179
|
+
const responseData = [];
|
|
180
|
+
const regex = /{{\s*.*?\s*}}/g;
|
|
181
|
+
const subjectExpressions = [];
|
|
182
|
+
const previewExpressions = [];
|
|
183
|
+
const textExpressions = [];
|
|
184
|
+
let textMatch;
|
|
185
|
+
while ((textMatch = regex.exec(textTemplate)) !== null) {
|
|
186
|
+
textExpressions.push(textMatch[0].trim());
|
|
187
|
+
}
|
|
188
|
+
let subjectMatch;
|
|
189
|
+
while ((subjectMatch = regex.exec(subject)) !== null) {
|
|
190
|
+
subjectExpressions.push(subjectMatch[0].trim());
|
|
191
|
+
}
|
|
192
|
+
let previewMatch;
|
|
193
|
+
while ((previewMatch = regex.exec(preview)) !== null) {
|
|
194
|
+
previewExpressions.push(previewMatch[0].trim());
|
|
195
|
+
}
|
|
196
|
+
let j = 0;
|
|
197
|
+
for (let i = 0; i < users.length; i += batchSize) {
|
|
198
|
+
const batchUsers = users.slice(i, i + batchSize);
|
|
199
|
+
let usersAndText = [];
|
|
200
|
+
for (const user of batchUsers) {
|
|
201
|
+
let replacements = [];
|
|
202
|
+
let personalizedSubject = subject;
|
|
203
|
+
let personalizedPreview = preview;
|
|
204
|
+
textExpressions.forEach(expression => {
|
|
205
|
+
let expressionValue = this.evaluateExpression(expression, j);
|
|
206
|
+
if (!expressionValue)
|
|
207
|
+
expressionValue = "";
|
|
208
|
+
replacements.push({ expression, expressionValue });
|
|
209
|
+
});
|
|
210
|
+
subjectExpressions.forEach(expression => {
|
|
211
|
+
let expressionValue = this.evaluateExpression(expression, j);
|
|
212
|
+
if (!expressionValue)
|
|
213
|
+
expressionValue = "";
|
|
214
|
+
personalizedSubject = personalizedSubject.replace(expression, expressionValue);
|
|
215
|
+
});
|
|
216
|
+
previewExpressions.forEach(expression => {
|
|
217
|
+
let expressionValue = this.evaluateExpression(expression, j);
|
|
218
|
+
if (!expressionValue)
|
|
219
|
+
expressionValue = "";
|
|
220
|
+
personalizedPreview = personalizedPreview.replace(expression, expressionValue);
|
|
221
|
+
});
|
|
222
|
+
j++;
|
|
223
|
+
if ('_id' in user.json) {
|
|
224
|
+
usersAndText.push({ "userId": user.json._id, "replacements": replacements, subject: personalizedSubject, preview: personalizedPreview });
|
|
225
|
+
}
|
|
226
|
+
else if ('body' in user.json && '_id' in user.json.body) {
|
|
227
|
+
usersAndText.push({ "userId": user.json.body._id, "replacements": replacements, subject: personalizedSubject, preview: personalizedPreview });
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
console.log('Invalid user format');
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const requestBody = {
|
|
234
|
+
usersAndText: usersAndText,
|
|
235
|
+
template: textTemplate,
|
|
236
|
+
emailName: emailName,
|
|
237
|
+
senderName: senderName,
|
|
238
|
+
once: oncePerEmail
|
|
239
|
+
};
|
|
240
|
+
const options = {
|
|
241
|
+
method: 'POST',
|
|
242
|
+
url: apiUrl,
|
|
243
|
+
body: requestBody,
|
|
244
|
+
headers: {
|
|
245
|
+
'Accept': 'application/json',
|
|
246
|
+
'Content-Type': 'application/json',
|
|
247
|
+
},
|
|
248
|
+
json: true,
|
|
249
|
+
};
|
|
250
|
+
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'novinMarketingApi', options);
|
|
251
|
+
if (Array.isArray(response)) {
|
|
252
|
+
responseData.push(...response);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
responseData.push(response);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return [this.helpers.returnJsonArray(responseData)];
|
|
259
|
+
}
|
|
177
260
|
}
|
|
178
261
|
exports.SendEmail = SendEmail;
|
|
179
262
|
//# sourceMappingURL=SendEmail.node.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SendEmail.node.js","sourceRoot":"","sources":["../../../nodes/SendEmail/SendEmail.node.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Send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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
c1.726,0,3.451-0.593,4.853-1.781l28.587-24.254c0.26,0.38,0.553,0.743,0.89,1.08l65.687,65.687H120.191L185.878,179.888z"/>
|
|
35
|
-
<path d="M7.5,170.676h126.667c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H7.5c-4.143,0-7.5,3.357-7.5,7.5
|
|
36
|
-
S3.357,170.676,7.5,170.676z"/>
|
|
37
|
-
<path d="M20.625,129.345H77.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H20.625c-4.143,0-7.5,3.357-7.5,7.5
|
|
38
|
-
S16.482,129.345,20.625,129.345z"/>
|
|
39
|
-
<path d="M62.5,226.51h-55c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h55c4.143,0,7.5-3.357,7.5-7.5S66.643,226.51,62.5,226.51z"
|
|
40
|
-
/>
|
|
41
|
-
</g>
|
|
42
|
-
</svg>
|
|
1
|
+
<?xml version="1.0" ?>
|
|
2
|
+
|
|
3
|
+
<svg width="800px" height="800px" viewBox="0 0 512 512" id="Layer_1" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
4
|
+
|
|
5
|
+
.st0{fill:#00B4D8;}
|
|
6
|
+
</style>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
1
|
+
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
2
|
export declare class SendSms implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
4
5
|
}
|