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,261 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SendEmailBatch = void 0;
|
|
4
|
-
class SendEmailBatch {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.description = {
|
|
7
|
-
displayName: 'Novin Send Email Batch',
|
|
8
|
-
name: 'sendEmailBatch',
|
|
9
|
-
icon: 'file:SendEmail.svg',
|
|
10
|
-
group: ['transform'],
|
|
11
|
-
version: [1, 2],
|
|
12
|
-
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
13
|
-
description: 'Node to Send Email Batch',
|
|
14
|
-
defaults: {
|
|
15
|
-
name: 'Novin Send Email Batch',
|
|
16
|
-
},
|
|
17
|
-
inputs: ['main'],
|
|
18
|
-
outputs: ['main'],
|
|
19
|
-
credentials: [
|
|
20
|
-
{
|
|
21
|
-
name: 'novinMarketingApi',
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
requestDefaults: {
|
|
26
|
-
baseURL: 'https://cdp.novin.marketing/api',
|
|
27
|
-
headers: {
|
|
28
|
-
Accept: 'application/json',
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
properties: [
|
|
33
|
-
{
|
|
34
|
-
displayName: 'Users',
|
|
35
|
-
name: 'users',
|
|
36
|
-
type: 'string',
|
|
37
|
-
default: '{{ $(previousNodename).all() }}',
|
|
38
|
-
placeholder: 'users List',
|
|
39
|
-
routing: {
|
|
40
|
-
send: {
|
|
41
|
-
property: 'users',
|
|
42
|
-
type: 'body',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
displayName: 'Email Name',
|
|
48
|
-
name: 'emailName',
|
|
49
|
-
type: 'string',
|
|
50
|
-
default: '',
|
|
51
|
-
placeholder: 'Name of the Email Campaign',
|
|
52
|
-
routing: {
|
|
53
|
-
send: {
|
|
54
|
-
property: 'emailName',
|
|
55
|
-
type: 'body',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
displayName: 'Sender Name',
|
|
61
|
-
name: 'senderName',
|
|
62
|
-
type: 'string',
|
|
63
|
-
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
64
|
-
placeholder: 'Enter Sender Name',
|
|
65
|
-
description: 'Sender Name of the email',
|
|
66
|
-
routing: {
|
|
67
|
-
send: {
|
|
68
|
-
property: 'senderName',
|
|
69
|
-
type: 'body',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
displayName: 'Subject',
|
|
75
|
-
name: 'subject',
|
|
76
|
-
type: 'string',
|
|
77
|
-
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
78
|
-
placeholder: 'Enter Subject',
|
|
79
|
-
description: 'Subject of the email',
|
|
80
|
-
routing: {
|
|
81
|
-
send: {
|
|
82
|
-
property: 'subject',
|
|
83
|
-
type: 'body',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
displayName: 'Preview',
|
|
89
|
-
name: 'preview',
|
|
90
|
-
type: 'string',
|
|
91
|
-
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
92
|
-
placeholder: 'Enter Preview',
|
|
93
|
-
description: 'Preview of the email',
|
|
94
|
-
routing: {
|
|
95
|
-
send: {
|
|
96
|
-
property: 'preview',
|
|
97
|
-
type: 'body',
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
displayName: 'Email Content',
|
|
103
|
-
name: 'content',
|
|
104
|
-
type: 'string',
|
|
105
|
-
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
106
|
-
placeholder: 'Enter Email content',
|
|
107
|
-
description: 'Content to send',
|
|
108
|
-
routing: {
|
|
109
|
-
send: {
|
|
110
|
-
property: 'content',
|
|
111
|
-
type: 'body',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
displayName: 'Once Per Email',
|
|
117
|
-
name: 'oncePerEmail',
|
|
118
|
-
type: 'boolean',
|
|
119
|
-
default: false,
|
|
120
|
-
routing: {
|
|
121
|
-
send: {
|
|
122
|
-
property: 'once',
|
|
123
|
-
type: 'body',
|
|
124
|
-
value: '={{$value}}',
|
|
125
|
-
},
|
|
126
|
-
},
|
|
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
|
-
},
|
|
141
|
-
],
|
|
142
|
-
};
|
|
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 personalizedText = textTemplate;
|
|
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
|
-
personalizedText = personalizedText.replace(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, "text": personalizedText, 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, "text": personalizedText, subject: personalizedSubject, preview: personalizedPreview });
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
console.log('Invalid user format');
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
const requestBody = {
|
|
234
|
-
usersAndText: usersAndText,
|
|
235
|
-
emailName: emailName,
|
|
236
|
-
senderName: senderName,
|
|
237
|
-
once: oncePerEmail
|
|
238
|
-
};
|
|
239
|
-
const options = {
|
|
240
|
-
method: 'POST',
|
|
241
|
-
url: apiUrl,
|
|
242
|
-
body: requestBody,
|
|
243
|
-
headers: {
|
|
244
|
-
'Accept': 'application/json',
|
|
245
|
-
'Content-Type': 'application/json',
|
|
246
|
-
},
|
|
247
|
-
json: true,
|
|
248
|
-
};
|
|
249
|
-
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'novinMarketingApi', options);
|
|
250
|
-
if (Array.isArray(response)) {
|
|
251
|
-
responseData.push(...response);
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
responseData.push(response);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
return [this.helpers.returnJsonArray(responseData)];
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
exports.SendEmailBatch = SendEmailBatch;
|
|
261
|
-
//# sourceMappingURL=SendEmailBatch.node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SendEmailBatch.node.js","sourceRoot":"","sources":["../../../nodes/SendEmailBatch/SendEmailBatch.node.ts"],"names":[],"mappings":";;;AASA,MAAa,cAAc;IAA3B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC;YACd,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE;gBACT,IAAI,EAAE,wBAAwB;aAC9B;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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OAAO,CAAC,CAAC;YAC3G,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;AAlRD,wCAkRC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"node": "n8n-nodes-base.SendEmailBatch",
|
|
3
|
-
"nodeVersion": "2",
|
|
4
|
-
"codexVersion": "2",
|
|
5
|
-
"categories": [
|
|
6
|
-
"Miscellaneous"
|
|
7
|
-
],
|
|
8
|
-
"resources": {
|
|
9
|
-
"credentialDocumentation": [
|
|
10
|
-
{
|
|
11
|
-
"url": ""
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"primaryDocumentation": [
|
|
15
|
-
{
|
|
16
|
-
"url": ""
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
-
<svg fill="#000000" width="800px" height="800px" viewBox="0 -32 576 576" xmlns="http://www.w3.org/2000/svg"><path d="M160 448c-25.6 0-51.2-22.4-64-32-64-44.8-83.2-60.8-96-70.4V480c0 17.67 14.33 32 32 32h256c17.67 0 32-14.33 32-32V345.6c-12.8 9.6-32 25.6-96 70.4-12.8 9.6-38.4 32-64 32zm128-192H32c-17.67 0-32 14.33-32 32v16c25.6 19.2 22.4 19.2 115.2 86.4 9.6 6.4 28.8 25.6 44.8 25.6s35.2-19.2 44.8-22.4c92.8-67.2 89.6-67.2 115.2-86.4V288c0-17.67-14.33-32-32-32zm256-96H224c-17.67 0-32 14.33-32 32v32h96c33.21 0 60.59 25.42 63.71 57.82l.29-.22V416h192c17.67 0 32-14.33 32-32V192c0-17.67-14.33-32-32-32zm-32 128h-64v-64h64v64zm-352-96c0-35.29 28.71-64 64-64h224V32c0-17.67-14.33-32-32-32H96C78.33 0 64 14.33 64 32v192h96v-32z"/></svg>
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SendSmsBatch = void 0;
|
|
4
|
-
class SendSmsBatch {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.description = {
|
|
7
|
-
displayName: 'Novin Send Sms Batch',
|
|
8
|
-
name: 'sendSmsBatch',
|
|
9
|
-
icon: 'file:SendSms.svg',
|
|
10
|
-
group: ['transform'],
|
|
11
|
-
version: [1],
|
|
12
|
-
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
13
|
-
description: 'Node to Send Sms In batch',
|
|
14
|
-
defaults: {
|
|
15
|
-
name: 'Novin Send Sms Batch',
|
|
16
|
-
},
|
|
17
|
-
inputs: ['main'],
|
|
18
|
-
outputs: ['main'],
|
|
19
|
-
credentials: [
|
|
20
|
-
{
|
|
21
|
-
name: 'novinMarketingApi',
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
requestDefaults: {
|
|
26
|
-
baseURL: 'https://cdp.novin.marketing/api',
|
|
27
|
-
headers: {
|
|
28
|
-
Accept: 'application/json',
|
|
29
|
-
'Content-Type': 'application/json',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
properties: [
|
|
33
|
-
{
|
|
34
|
-
displayName: 'Users',
|
|
35
|
-
name: 'users',
|
|
36
|
-
type: 'string',
|
|
37
|
-
default: '{{ $(previousNodename).all() }}',
|
|
38
|
-
placeholder: 'users _id',
|
|
39
|
-
routing: {
|
|
40
|
-
send: {
|
|
41
|
-
property: 'users',
|
|
42
|
-
type: 'body',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
displayName: 'Sms Name',
|
|
48
|
-
name: 'smsName',
|
|
49
|
-
type: 'string',
|
|
50
|
-
default: '',
|
|
51
|
-
placeholder: 'Name of the SMS Campaign',
|
|
52
|
-
routing: {
|
|
53
|
-
send: {
|
|
54
|
-
property: 'smsName',
|
|
55
|
-
type: 'body',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
displayName: 'Sms Message',
|
|
61
|
-
name: 'text',
|
|
62
|
-
type: 'string',
|
|
63
|
-
default: '{{ $(previousNodename).item.json.firstName.value }}',
|
|
64
|
-
placeholder: 'Enter Sms text',
|
|
65
|
-
routing: {
|
|
66
|
-
send: {
|
|
67
|
-
property: 'text',
|
|
68
|
-
type: 'body',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
displayName: 'Once Per Mobile Number',
|
|
74
|
-
name: 'oncePerMobileNumber',
|
|
75
|
-
type: 'boolean',
|
|
76
|
-
default: false,
|
|
77
|
-
routing: {
|
|
78
|
-
send: {
|
|
79
|
-
property: 'once',
|
|
80
|
-
type: 'body',
|
|
81
|
-
value: '={{$value}}',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
displayName: 'Dont Disturb',
|
|
87
|
-
name: 'dontDisturb',
|
|
88
|
-
type: 'boolean',
|
|
89
|
-
default: true,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
displayName: 'Batch Size',
|
|
93
|
-
name: 'batchSize',
|
|
94
|
-
type: 'number',
|
|
95
|
-
default: 100,
|
|
96
|
-
description: 'Number of messages to accumulate before sending a batch',
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
async execute() {
|
|
102
|
-
const users = this.getNodeParameter('users', 0);
|
|
103
|
-
const dontDisturb = this.getNodeParameter('dontDisturb', 0);
|
|
104
|
-
const oncePerMobileNumber = this.getNodeParameter('oncePerMobileNumber', 0);
|
|
105
|
-
const parameters = this.getNode().parameters;
|
|
106
|
-
let textTemplate = parameters.text;
|
|
107
|
-
if (textTemplate.startsWith('=')) {
|
|
108
|
-
textTemplate = textTemplate.substring(1);
|
|
109
|
-
}
|
|
110
|
-
const smsName = this.getNodeParameter('smsName', 0);
|
|
111
|
-
const batchSize = this.getNodeParameter('batchSize', 0);
|
|
112
|
-
if (dontDisturb) {
|
|
113
|
-
const currentTime = new Date();
|
|
114
|
-
const currentHour = currentTime.getHours();
|
|
115
|
-
if (currentHour >= 22 || currentHour < 9) {
|
|
116
|
-
let waitTime = 0;
|
|
117
|
-
if (currentHour >= 22) {
|
|
118
|
-
waitTime = (24 - currentHour + 9) * 60 * 60 * 1000 - currentTime.getMinutes() * 60 * 1000 - currentTime.getSeconds() * 1000 - currentTime.getMilliseconds();
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
waitTime = (9 - currentHour) * 60 * 60 * 1000 - currentTime.getMinutes() * 60 * 1000 - currentTime.getSeconds() * 1000 - currentTime.getMilliseconds();
|
|
122
|
-
}
|
|
123
|
-
await new Promise(resolve => setTimeout(resolve, waitTime));
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
const apiUrl = 'https://cdp.novin.marketing/api/users/sendSMSBatch';
|
|
127
|
-
const responseData = [];
|
|
128
|
-
const regex = /{{\s*\$\(.*?\)\.item\.json\.(.*?)\s*}}/g;
|
|
129
|
-
const expressions = [];
|
|
130
|
-
let match;
|
|
131
|
-
while ((match = regex.exec(textTemplate)) !== null) {
|
|
132
|
-
expressions.push(match[0].trim());
|
|
133
|
-
}
|
|
134
|
-
let usersAndText = [];
|
|
135
|
-
let requestBody;
|
|
136
|
-
if (typeof users == 'string') {
|
|
137
|
-
let pText = textTemplate;
|
|
138
|
-
expressions.forEach(expression => {
|
|
139
|
-
let expressionValue = this.evaluateExpression(expression, 0);
|
|
140
|
-
if (!expressionValue)
|
|
141
|
-
expressionValue = "";
|
|
142
|
-
pText = pText.replace(expression, expressionValue);
|
|
143
|
-
});
|
|
144
|
-
requestBody = {
|
|
145
|
-
usersAndText: users,
|
|
146
|
-
text: pText,
|
|
147
|
-
smsName: smsName,
|
|
148
|
-
once: oncePerMobileNumber
|
|
149
|
-
};
|
|
150
|
-
const options = {
|
|
151
|
-
method: 'POST',
|
|
152
|
-
url: apiUrl,
|
|
153
|
-
body: requestBody,
|
|
154
|
-
headers: {
|
|
155
|
-
'Accept': 'application/json',
|
|
156
|
-
'Content-Type': 'application/json',
|
|
157
|
-
},
|
|
158
|
-
json: true,
|
|
159
|
-
};
|
|
160
|
-
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'novinMarketingApi', options);
|
|
161
|
-
if (Array.isArray(response)) {
|
|
162
|
-
responseData.push(...response);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
responseData.push(response);
|
|
166
|
-
}
|
|
167
|
-
return [this.helpers.returnJsonArray(responseData)];
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
let j = 0;
|
|
171
|
-
for (let i = 0; i < users.length; i += batchSize) {
|
|
172
|
-
const batchUsers = users.slice(i, i + batchSize);
|
|
173
|
-
usersAndText = [];
|
|
174
|
-
for (const user of batchUsers) {
|
|
175
|
-
let personalizedText = textTemplate;
|
|
176
|
-
expressions.forEach(expression => {
|
|
177
|
-
let expressionValue = this.evaluateExpression(expression, j);
|
|
178
|
-
if (!expressionValue)
|
|
179
|
-
expressionValue = "";
|
|
180
|
-
personalizedText = personalizedText.replace(expression, expressionValue);
|
|
181
|
-
});
|
|
182
|
-
j++;
|
|
183
|
-
if ('_id' in user.json) {
|
|
184
|
-
usersAndText.push({ "userId": user.json._id, "text": personalizedText });
|
|
185
|
-
}
|
|
186
|
-
else if ('body' in user.json && '_id' in user.json.body) {
|
|
187
|
-
usersAndText.push({ "userId": user.json.body._id, "text": personalizedText });
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
console.log('Invalid user format');
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
requestBody = {
|
|
194
|
-
usersAndText: usersAndText,
|
|
195
|
-
smsName: smsName,
|
|
196
|
-
once: oncePerMobileNumber
|
|
197
|
-
};
|
|
198
|
-
const options = {
|
|
199
|
-
method: 'POST',
|
|
200
|
-
url: apiUrl,
|
|
201
|
-
body: requestBody,
|
|
202
|
-
headers: {
|
|
203
|
-
'Accept': 'application/json',
|
|
204
|
-
'Content-Type': 'application/json',
|
|
205
|
-
},
|
|
206
|
-
json: true,
|
|
207
|
-
};
|
|
208
|
-
const response = await this.helpers.httpRequestWithAuthentication.call(this, 'novinMarketingApi', options);
|
|
209
|
-
if (Array.isArray(response)) {
|
|
210
|
-
responseData.push(...response);
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
responseData.push(response);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return [this.helpers.returnJsonArray(responseData)];
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
exports.SendSmsBatch = SendSmsBatch;
|
|
221
|
-
//# sourceMappingURL=SendSmsBatch.node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SendSmsBatch.node.js","sourceRoot":"","sources":["../../../nodes/SendSmsBatch/SendSmsBatch.node.ts"],"names":[],"mappings":";;;AASA,MAAa,YAAY;IAAzB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,CAAC;YACZ,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,2BAA2B;YACxC,QAAQ,EAAE;gBACT,IAAI,EAAE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AO,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;gBAC3G,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;oBAC5B,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;iBAC/B;qBAAM;oBACN,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBAC5B;aACD;YACD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC;SACpD;IACF,CAAC;CAED;AA/ND,oCA+NC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { INodeType, INodeTypeDescription, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
|
2
|
-
export declare class SendToCallCenter implements INodeType {
|
|
3
|
-
description: INodeTypeDescription;
|
|
4
|
-
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SendToCallCenter.node.js","sourceRoot":"","sources":["../../../nodes/SendToCallCenter/SendToCallCenter.node.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAA7B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,2BAA2B;YACjC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC,CAAC,CAAC;YACZ,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE;gBACT,IAAI,EAAE,gCAAgC;aACtC;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;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Version": "3",
|
|
4
|
-
"codexVersion": "3",
|
|
5
|
-
"categories": [
|
|
6
|
-
"Miscellaneous"
|
|
7
|
-
],
|
|
8
|
-
"resources": {
|
|
9
|
-
"credentialDocumentation": [
|
|
10
|
-
{
|
|
11
|
-
"url": ""
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"primaryDocumentation": [
|
|
15
|
-
{
|
|
16
|
-
"url": ""
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
}
|
|
File without changes
|