@tiledesk/tiledesk-tybot-connector 0.2.11 → 0.2.13
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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
### v0.2.13 - test
|
|
9
|
+
- replyto send email test
|
|
10
|
+
|
|
11
|
+
### 0.2.12
|
|
12
|
+
- Updated @tiledesk/tiledesk-client => 0.10.4 to support the new email endpoint
|
|
13
|
+
|
|
8
14
|
### 0.2.11
|
|
9
15
|
- TiledeskClient update to 0.10.3
|
|
10
16
|
- updateLead() replaces the deprecated updateLeadData()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiledesk/tiledesk-tybot-connector",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "Tiledesk Tybot connector",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@tiledesk/helpcenter-query-client": "^0.1.8",
|
|
15
15
|
"@tiledesk/tiledesk-chatbot-client": "^0.5.30",
|
|
16
16
|
"@tiledesk/tiledesk-chatbot-util": "^0.8.39",
|
|
17
|
-
"@tiledesk/tiledesk-client": "^0.10.
|
|
17
|
+
"@tiledesk/tiledesk-client": "^0.10.4",
|
|
18
18
|
"accept-language-parser": "^1.5.0",
|
|
19
19
|
"axios": "^0.27.2",
|
|
20
20
|
"body-parser": "^1.19.0",
|
|
@@ -58,7 +58,8 @@ class FillParamsChatbotPlug {
|
|
|
58
58
|
if (commands.length > 1) {
|
|
59
59
|
for (let i = 0; i < commands.length; i++) {
|
|
60
60
|
if (commands[i].type === 'message' && commands[i].message && commands[i].message.text) {
|
|
61
|
-
let filled_reply = this.fillWithRequestParams(commands[i].message.text, all_parameters);
|
|
61
|
+
// let filled_reply = this.fillWithRequestParams(commands[i].message.text, all_parameters);
|
|
62
|
+
let filled_reply = filler.fill(commands[i].message.text, all_parameters);
|
|
62
63
|
commands[i].message.text = filled_reply;
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -73,23 +74,23 @@ class FillParamsChatbotPlug {
|
|
|
73
74
|
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
fillWithRequestParams(message_text, all_parameters) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
77
|
+
// fillWithRequestParams(message_text, all_parameters) {
|
|
78
|
+
// if (this.log) {console.log("collected parameters:", JSON.stringify(all_parameters));}
|
|
79
|
+
// if (!message_text) {
|
|
80
|
+
// if (this.log) {console.log("fillWithRequestParams() Can't fill. message_text is null");}
|
|
81
|
+
// return;
|
|
82
|
+
// }
|
|
83
|
+
// if (all_parameters) {
|
|
84
|
+
// for (const [key, value] of Object.entries(all_parameters)) {
|
|
85
|
+
// // const value = all_parameters[key];
|
|
86
|
+
// const value_type = typeof value;
|
|
87
|
+
// if (this.log) {console.log("checking parameter:", key, "value:", value, "type:", value_type)}
|
|
88
|
+
// message_text = message_text.replace(new RegExp("(\\$\\{" + key + "\\})", 'i'), value);
|
|
89
|
+
// }
|
|
90
|
+
// if (this.log) {console.log("final:", message_text);}
|
|
91
|
+
// }
|
|
92
|
+
// return message_text;
|
|
93
|
+
// }
|
|
93
94
|
|
|
94
95
|
}
|
|
95
96
|
|
|
@@ -75,14 +75,17 @@ class DirSendEmail {
|
|
|
75
75
|
const filled_subject = filler.fill(action.subject, requestVariables);
|
|
76
76
|
const filled_text = filler.fill(action.text, requestVariables);
|
|
77
77
|
const filled_to = filler.fill(action.to, requestVariables);
|
|
78
|
+
const reply_to = filler.fill(action.reply_to, requestVariables);
|
|
78
79
|
const message_echo = await this.tdclient.sendEmail({
|
|
79
80
|
subject: filled_subject,
|
|
80
81
|
text: filled_text,
|
|
81
|
-
to: filled_to
|
|
82
|
+
to: filled_to,
|
|
83
|
+
replyto: "andreasponziello@tiledesk.com"
|
|
82
84
|
});
|
|
83
85
|
if (this.log) {console.log("email sent. filled_subject:", filled_subject);}
|
|
84
86
|
if (this.log) {console.log("email sent. filled_text:", filled_text);}
|
|
85
87
|
if (this.log) {console.log("email sent. filled_to:", filled_to);}
|
|
88
|
+
if (this.log) {console.log("email sent. reply_to:", reply_to);}
|
|
86
89
|
if (completion) {
|
|
87
90
|
completion(null, message_echo);
|
|
88
91
|
}
|