@tiledesk/tiledesk-server 2.3.70 → 2.3.72
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +15 -2
- package/channels/chat21/chat21WebHook.js +14 -5
- package/models/faq.js +4 -0
- package/models/message.js +9 -7
- package/package.json +3 -3
- package/pubmodules/apps/listener.js +1 -0
- package/pubmodules/kaleyra/index.js +6 -0
- package/pubmodules/kaleyra/listener.js +32 -0
- package/pubmodules/pubModulesManager.js +23 -1
- package/routes/email.js +13 -7
- package/routes/faq.js +6 -0
- package/routes/faq_kb.js +7 -4
- package/routes/message.js +29 -12
- package/routes/project_user.js +2 -1
- package/services/emailService.js +4 -3
- package/services/messageService.js +2 -1
- package/services/requestService.js +13 -7
- package/template/email/assignedEmailMessage.html +21 -12
- package/template/email/assignedRequest.html +21 -12
- package/template/email/beenInvitedExistingUser.html +15 -6
- package/template/email/beenInvitedNewUser.html +15 -6
- package/template/email/emailDirect.html +15 -6
- package/template/email/newMessage.html +18 -9
- package/template/email/newMessageFollower.html +22 -13
- package/template/email/passwordChanged.html +15 -6
- package/template/email/pooledEmailMessage.html +21 -12
- package/template/email/pooledRequest.html +20 -11
- package/template/email/resetPassword.html +15 -6
- package/template/email/sendTranscript.html +6 -4
- package/template/email/ticket.html +17 -8
- package/template/email/verify.html +15 -5
- package/test/requestService.js +55 -4
- package/utils/recipientEmailUtil.js +66 -0
- package/docker-compose.yml +0 -166
- package/version +0 -69
- package/versions +0 -69
@@ -11,9 +11,19 @@
|
|
11
11
|
img {
|
12
12
|
max-width: 100%;
|
13
13
|
margin-left:16px;
|
14
|
-
margin-bottom:16px;
|
15
14
|
text-align:center !important;
|
16
15
|
}
|
16
|
+
img.CToWUd {
|
17
|
+
margin-bottom: 16px;
|
18
|
+
max-width: 200px !important;
|
19
|
+
width: 200px !important;
|
20
|
+
min-width: 200px !important;
|
21
|
+
outline: none;
|
22
|
+
text-decoration: none;
|
23
|
+
border: none;
|
24
|
+
height: auto;
|
25
|
+
margin-left: 0px;
|
26
|
+
}
|
17
27
|
body {
|
18
28
|
-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
|
19
29
|
}
|
@@ -82,8 +92,7 @@
|
|
82
92
|
|
83
93
|
<div style="text-align:center">
|
84
94
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
85
|
-
|
86
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
95
|
+
<img src="https://tiledesk.com/wp-content/uploads/2023/01/tiledesk_log_email_200.png" class="CToWUd">
|
87
96
|
</a>
|
88
97
|
</div>
|
89
98
|
</tr>
|
@@ -103,7 +112,7 @@
|
|
103
112
|
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
104
113
|
|
105
114
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
106
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
115
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
107
116
|
{{#ifEquals message.type "text"}}
|
108
117
|
<div style="white-space: pre-wrap;">{{{msgText}}}</div>
|
109
118
|
{{/ifEquals}}
|
@@ -121,26 +130,26 @@
|
|
121
130
|
|
122
131
|
|
123
132
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
124
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
133
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
125
134
|
Project name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{project.name}}</strong>
|
126
135
|
</td>
|
127
136
|
</tr>
|
128
137
|
|
129
138
|
|
130
139
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
131
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
140
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
132
141
|
Department name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{request.department.name}}</strong>
|
133
142
|
</td>
|
134
143
|
</tr>
|
135
144
|
|
136
145
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
137
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
146
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
138
147
|
From email : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{request.lead.email}}</strong>
|
139
148
|
</td>
|
140
149
|
</tr>
|
141
150
|
|
142
151
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
143
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
152
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
144
153
|
Contact name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{request.lead.fullname}}</strong>
|
145
154
|
</td>
|
146
155
|
</tr>
|
@@ -152,7 +161,7 @@
|
|
152
161
|
</tr> -->
|
153
162
|
|
154
163
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
155
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
164
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
156
165
|
Channel : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
157
166
|
|
158
167
|
{{#ifEquals request.channel.name "chat21"}}
|
@@ -167,7 +176,7 @@
|
|
167
176
|
</tr>
|
168
177
|
|
169
178
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
170
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
179
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
171
180
|
<a href="{{baseScope.baseUrl}}/#/project/{{request.id_project}}/wsrequest/{{request.request_id}}/messages">Open the dashboard</a>.
|
172
181
|
|
173
182
|
</td>
|
@@ -178,7 +187,7 @@
|
|
178
187
|
|
179
188
|
|
180
189
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
181
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
190
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
182
191
|
</td>
|
183
192
|
</tr>
|
184
193
|
</table>
|
@@ -188,7 +197,7 @@
|
|
188
197
|
<div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
|
189
198
|
<table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
190
199
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
191
|
-
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;
|
200
|
+
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;" align="center" valign="top">
|
192
201
|
<span><a href="http://www.tiledesk.com" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;" > Tiledesk.com </a></span>
|
193
202
|
<br><span><a href="%unsubscribe_url%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">Unsubscribe</a></span>
|
194
203
|
</td>
|
@@ -10,9 +10,19 @@
|
|
10
10
|
img {
|
11
11
|
max-width: 100%;
|
12
12
|
margin-left:16px;
|
13
|
-
margin-bottom:16px;
|
14
13
|
text-align:center !important;
|
15
14
|
}
|
15
|
+
img.CToWUd {
|
16
|
+
margin-bottom: 16px;
|
17
|
+
max-width: 200px !important;
|
18
|
+
width: 200px !important;
|
19
|
+
min-width: 200px !important;
|
20
|
+
outline: none;
|
21
|
+
text-decoration: none;
|
22
|
+
border: none;
|
23
|
+
height: auto;
|
24
|
+
margin-left: 0px;
|
25
|
+
}
|
16
26
|
body {
|
17
27
|
-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
|
18
28
|
}
|
@@ -82,8 +92,7 @@
|
|
82
92
|
|
83
93
|
<div style="text-align:center">
|
84
94
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
85
|
-
|
86
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
95
|
+
<img src="https://tiledesk.com/wp-content/uploads/2023/01/tiledesk_log_email_200.png" class="CToWUd">
|
87
96
|
</a>
|
88
97
|
</div>
|
89
98
|
</tr>
|
@@ -104,7 +113,7 @@
|
|
104
113
|
|
105
114
|
|
106
115
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
107
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
116
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
108
117
|
<div style="white-space: pre-wrap;">{{{msgText}}}</div>
|
109
118
|
</td>
|
110
119
|
</tr>
|
@@ -113,7 +122,7 @@
|
|
113
122
|
|
114
123
|
|
115
124
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
116
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
125
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
117
126
|
Project name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{project.name}}</strong>
|
118
127
|
</td>
|
119
128
|
</tr>
|
@@ -121,19 +130,19 @@
|
|
121
130
|
|
122
131
|
|
123
132
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
124
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
133
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
125
134
|
Department name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{request.department.name}}</strong>
|
126
135
|
</td>
|
127
136
|
</tr>
|
128
137
|
|
129
138
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
130
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
139
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
131
140
|
Source page : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{request.sourcePage}}</strong>
|
132
141
|
</td>
|
133
142
|
</tr>
|
134
143
|
|
135
144
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
136
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
145
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
137
146
|
Contact name : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{request.lead.fullname}}</strong>
|
138
147
|
</td>
|
139
148
|
</tr>
|
@@ -141,7 +150,7 @@
|
|
141
150
|
|
142
151
|
|
143
152
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
144
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
153
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
145
154
|
Channel : <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
146
155
|
|
147
156
|
{{#ifEquals request.channel.name "chat21"}}
|
@@ -156,7 +165,7 @@
|
|
156
165
|
</tr>
|
157
166
|
|
158
167
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
159
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
168
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
160
169
|
<a href="{{baseScope.baseUrl}}/#/project/{{request.id_project}}/wsrequest/{{request.request_id}}/messages">Open the dashboard</a>.
|
161
170
|
|
162
171
|
</td>
|
@@ -177,7 +186,7 @@
|
|
177
186
|
<div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
|
178
187
|
<table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
179
188
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
180
|
-
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;
|
189
|
+
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;" align="center" valign="top">
|
181
190
|
<span><a href="http://www.tiledesk.com" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;" > Tiledesk.com </a></span>
|
182
191
|
<br><span><a href="%unsubscribe_url%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">Unsubscribe</a></span>
|
183
192
|
</td>
|
@@ -9,9 +9,19 @@
|
|
9
9
|
img {
|
10
10
|
max-width: 100%;
|
11
11
|
margin-left:16px;
|
12
|
-
margin-bottom:16px;
|
13
12
|
text-align:center !important;
|
14
13
|
}
|
14
|
+
img.CToWUd {
|
15
|
+
margin-bottom: 16px;
|
16
|
+
max-width: 200px !important;
|
17
|
+
width: 200px !important;
|
18
|
+
min-width: 200px !important;
|
19
|
+
outline: none;
|
20
|
+
text-decoration: none;
|
21
|
+
border: none;
|
22
|
+
height: auto;
|
23
|
+
margin-left: 0px;
|
24
|
+
}
|
15
25
|
body {
|
16
26
|
-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
|
17
27
|
}
|
@@ -71,8 +81,7 @@
|
|
71
81
|
|
72
82
|
<div style="text-align:center">
|
73
83
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
74
|
-
|
75
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
84
|
+
<img src="https://tiledesk.com/wp-content/uploads/2023/01/tiledesk_log_email_200.png" class="CToWUd">
|
76
85
|
</a>
|
77
86
|
</div>
|
78
87
|
|
@@ -85,7 +94,7 @@
|
|
85
94
|
|
86
95
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
87
96
|
|
88
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
97
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
89
98
|
<h2 style="text-align: center; letter-spacing: 1px; ">
|
90
99
|
Password reset request
|
91
100
|
</h2>
|
@@ -109,7 +118,7 @@
|
|
109
118
|
</tr>
|
110
119
|
|
111
120
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
112
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
121
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
113
122
|
</td>
|
114
123
|
</tr>
|
115
124
|
</table>
|
@@ -119,7 +128,7 @@
|
|
119
128
|
<div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
|
120
129
|
<table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
121
130
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
122
|
-
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;
|
131
|
+
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;" align="center" valign="top">
|
123
132
|
<span><a href="http://www.tiledesk.com" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;" > Tiledesk.com </a></span>
|
124
133
|
<br><span><a href="%unsubscribe_url%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">Unsubscribe</a></span>
|
125
134
|
</td>
|
@@ -76,7 +76,7 @@
|
|
76
76
|
<div style="text-align:center">
|
77
77
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
78
78
|
<!-- <img src="https://tiledesk.com/tiledesk-logo.png" style="width:50%;outline:none;text-decoration:none;border:none;min-height:36px" class="CToWUd"> -->
|
79
|
-
<img src="https://tiledesk.com/wp-content/uploads/
|
79
|
+
<img src="https://tiledesk.com/wp-content/uploads/2023/01/tiledesk_log_email_200.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
80
80
|
</a>
|
81
81
|
</div>
|
82
82
|
</tr>
|
@@ -92,7 +92,9 @@
|
|
92
92
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
93
93
|
|
94
94
|
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
|
95
|
-
<strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"
|
95
|
+
<!-- <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">-->
|
96
|
+
Hi,
|
97
|
+
<!-- </strong> -->
|
96
98
|
<br><br> here's the transcript of your conversation.
|
97
99
|
|
98
100
|
</td>
|
@@ -108,7 +110,7 @@
|
|
108
110
|
|
109
111
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
110
112
|
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;" valign="top">
|
111
|
-
<strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
113
|
+
<!-- <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;"> -->
|
112
114
|
|
113
115
|
|
114
116
|
|
@@ -118,7 +120,7 @@
|
|
118
120
|
|
119
121
|
|
120
122
|
|
121
|
-
|
123
|
+
<!-- </strong> -->
|
122
124
|
</td>
|
123
125
|
</tr>
|
124
126
|
|
@@ -10,9 +10,19 @@
|
|
10
10
|
img {
|
11
11
|
max-width: 100%;
|
12
12
|
margin-left:16px;
|
13
|
-
margin-bottom:16px;
|
14
13
|
text-align:center !important;
|
15
14
|
}
|
15
|
+
img.CToWUd {
|
16
|
+
margin-bottom: 16px;
|
17
|
+
max-width: 200px !important;
|
18
|
+
width: 200px !important;
|
19
|
+
min-width: 200px !important;
|
20
|
+
outline: none;
|
21
|
+
text-decoration: none;
|
22
|
+
border: none;
|
23
|
+
height: auto;
|
24
|
+
margin-left: 0px;
|
25
|
+
}
|
16
26
|
body {
|
17
27
|
-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
|
18
28
|
}
|
@@ -75,8 +85,7 @@
|
|
75
85
|
|
76
86
|
<div style="text-align:center">
|
77
87
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
78
|
-
|
79
|
-
<img src="https://tiledesk.com/wp-content/uploads/2022/09/tiledeesk_log_email.png" style="max-width:200px;outline:none;text-decoration:none;border:none;height:auto;margin-left:0px;" class="CToWUd">
|
88
|
+
<img src="https://tiledesk.com/wp-content/uploads/2023/01/tiledesk_log_email_200.png" class="CToWUd">
|
80
89
|
</a>
|
81
90
|
</div>
|
82
91
|
</td>
|
@@ -98,7 +107,7 @@
|
|
98
107
|
|
99
108
|
|
100
109
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
101
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
110
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
102
111
|
Sender: <strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">{{message.senderFullname}}</strong>
|
103
112
|
</td>
|
104
113
|
</tr>
|
@@ -106,7 +115,7 @@
|
|
106
115
|
|
107
116
|
|
108
117
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
109
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
118
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
110
119
|
{{#ifEquals message.type "text"}}
|
111
120
|
<div style="white-space: pre-wrap;">{{{msgText}}}</div>
|
112
121
|
{{/ifEquals}}
|
@@ -162,7 +171,7 @@
|
|
162
171
|
|
163
172
|
|
164
173
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
165
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
174
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
166
175
|
|
167
176
|
Click <a href="{{seamlessPage}}{{tokenQueryString}}">here</a> to continue by chat the conversation.
|
168
177
|
</td>
|
@@ -171,7 +180,7 @@
|
|
171
180
|
|
172
181
|
|
173
182
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
174
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
183
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
175
184
|
</td>
|
176
185
|
</tr>
|
177
186
|
</table>
|
@@ -181,7 +190,7 @@
|
|
181
190
|
<div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
|
182
191
|
<table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
183
192
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
184
|
-
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;
|
193
|
+
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;" align="center" valign="top">
|
185
194
|
<span><a href="http://www.tiledesk.com" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;" > Tiledesk.com </a></span>
|
186
195
|
<!-- <br><span><a href="%unsubscribe_url%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">Unsubscribe</a></span> -->
|
187
196
|
</td>
|
@@ -10,9 +10,19 @@
|
|
10
10
|
img {
|
11
11
|
max-width: 100%;
|
12
12
|
margin-left:16px;
|
13
|
-
margin-bottom:16px;
|
14
13
|
text-align:center !important;
|
15
14
|
}
|
15
|
+
img.CToWUd {
|
16
|
+
margin-bottom: 16px;
|
17
|
+
max-width: 200px !important;
|
18
|
+
width: 200px !important;
|
19
|
+
min-width: 200px !important;
|
20
|
+
outline: none;
|
21
|
+
text-decoration: none;
|
22
|
+
border: none;
|
23
|
+
height: auto;
|
24
|
+
margin-left: 0px;
|
25
|
+
}
|
16
26
|
body {
|
17
27
|
-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em;
|
18
28
|
}
|
@@ -75,7 +85,7 @@
|
|
75
85
|
|
76
86
|
<div style="text-align:center">
|
77
87
|
<a href="http://www.tiledesk.com" style="color:#2daae1;font-weight:bold;text-decoration:none;word-break:break-word" target="_blank">
|
78
|
-
<img src="https://tiledesk.com/tiledesk-logo.png"
|
88
|
+
<img src="https://tiledesk.com/tiledesk-logo.png" class="CToWUd">
|
79
89
|
</a>
|
80
90
|
</div>
|
81
91
|
</tr>
|
@@ -97,7 +107,7 @@
|
|
97
107
|
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
98
108
|
|
99
109
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
100
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
110
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
101
111
|
<strong style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">Hi {{savedUser.firstname}} {{savedUser.lastname}},</strong>
|
102
112
|
<!-- <br> welcome on TileDesk.com. -->
|
103
113
|
<br><br> Thank you for signin up with TileDesk.
|
@@ -108,7 +118,7 @@
|
|
108
118
|
</tr>
|
109
119
|
|
110
120
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
111
|
-
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;
|
121
|
+
<td class="content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;" valign="top">
|
112
122
|
</td>
|
113
123
|
</tr>
|
114
124
|
</table>
|
@@ -118,7 +128,7 @@
|
|
118
128
|
<div class="footer" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; clear: both; color: #999; margin: 0; padding: 20px;">
|
119
129
|
<table width="100%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
120
130
|
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
121
|
-
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;
|
131
|
+
<td class="aligncenter content-block" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; vertical-align: top; color: #999; text-align: center; margin: 0;" align="center" valign="top">
|
122
132
|
<span><a href="http://www.tiledesk.com" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;" > Tiledesk.com </a></span>
|
123
133
|
<br><span><a href="%unsubscribe_url%" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">Unsubscribe</a></span>
|
124
134
|
</td>
|
package/test/requestService.js
CHANGED
@@ -633,7 +633,7 @@ describe('RequestService', function () {
|
|
633
633
|
savedProject._id, messageSender),
|
634
634
|
messageService.create(messageSender, "test sender", savedRequest.request_id, "hello2",
|
635
635
|
savedProject._id, messageSender)]).then(function(all) {
|
636
|
-
requestService.updateWaitingTimeByRequestId(savedRequest.request_id, savedProject._id).then(function(upRequest) {
|
636
|
+
requestService.updateWaitingTimeByRequestId(savedRequest.request_id, savedProject._id, true).then(function(upRequest) {
|
637
637
|
var maxWaitingTime = Date.now() - upRequest.createdAt;
|
638
638
|
console.log("resolve closedRequest", upRequest.toObject(),maxWaitingTime);
|
639
639
|
|
@@ -669,7 +669,52 @@ describe('RequestService', function () {
|
|
669
669
|
// mocha test/requestService.js --grep 'closeRequest'
|
670
670
|
|
671
671
|
|
672
|
-
|
672
|
+
it('closeRequest', function (done) {
|
673
|
+
|
674
|
+
var email = "test-request-create-" + Date.now() + "@email.com";
|
675
|
+
var pwd = "pwd";
|
676
|
+
|
677
|
+
userService.signup( email ,pwd, "Test Firstname", "Test lastname").then(function(savedUser) {
|
678
|
+
var userid = savedUser.id;
|
679
|
+
|
680
|
+
projectService.createAndReturnProjectAndProjectUser("test1", userid).then(function(savedProjectAndPU) {
|
681
|
+
var savedProject = savedProjectAndPU.project;
|
682
|
+
var now = Date.now();
|
683
|
+
requestService.createWithIdAndRequester("request_id-closeRequest-"+now, savedProjectAndPU.project_user._id, null, savedProject._id, "first_text").then(function(savedRequest) {
|
684
|
+
Promise.all([
|
685
|
+
messageService.create("5badfe5d553d1844ad654072", "test sender", savedRequest.request_id, "hello1",
|
686
|
+
savedProject._id, "5badfe5d553d1844ad654072"),
|
687
|
+
messageService.create("5badfe5d553d1844ad654072", "test sender", savedRequest.request_id, "hello2",
|
688
|
+
savedProject._id, "5badfe5d553d1844ad654072")]).then(function(all) {
|
689
|
+
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
690
|
+
requestService.closeRequestByRequestId(savedRequest.request_id, savedProject._id, false, true, "user1").then(function(closedRequest) {
|
691
|
+
winston.debug("resolve closedRequest", closedRequest.toObject());
|
692
|
+
expect(closedRequest.status).to.equal(1000);
|
693
|
+
expect(closedRequest.closed_at).to.not.equal(null);
|
694
|
+
expect(closedRequest.transcript).to.contains("hello1");
|
695
|
+
expect(closedRequest.transcript).to.contains("hello2");
|
696
|
+
expect(closedRequest.snapshot.agents).to.equal(undefined);
|
697
|
+
expect(closedRequest.closed_by).to.equal("user1");
|
698
|
+
|
699
|
+
done();
|
700
|
+
}).catch(function(err){
|
701
|
+
winston.error("test reject", err);
|
702
|
+
assert.isNotOk(err,'Promise error');
|
703
|
+
done();
|
704
|
+
});
|
705
|
+
});
|
706
|
+
});
|
707
|
+
});
|
708
|
+
});
|
709
|
+
});
|
710
|
+
|
711
|
+
|
712
|
+
|
713
|
+
|
714
|
+
// mocha test/requestService.js --grep 'closeRequestForce'
|
715
|
+
|
716
|
+
|
717
|
+
it('closeRequestForce', function (done) {
|
673
718
|
|
674
719
|
var email = "test-request-create-" + Date.now() + "@email.com";
|
675
720
|
var pwd = "pwd";
|
@@ -686,7 +731,7 @@ describe('RequestService', function () {
|
|
686
731
|
savedProject._id, "5badfe5d553d1844ad654072"),
|
687
732
|
messageService.create("5badfe5d553d1844ad654072", "test sender", savedRequest.request_id, "hello2",
|
688
733
|
savedProject._id, "5badfe5d553d1844ad654072")]).then(function(all) {
|
689
|
-
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by)
|
734
|
+
// closeRequestByRequestId(request_id, id_project, skipStatsUpdate, notify, closed_by, force)
|
690
735
|
requestService.closeRequestByRequestId(savedRequest.request_id, savedProject._id, false, true, "user1").then(function(closedRequest) {
|
691
736
|
winston.debug("resolve closedRequest", closedRequest.toObject());
|
692
737
|
expect(closedRequest.status).to.equal(1000);
|
@@ -696,7 +741,11 @@ describe('RequestService', function () {
|
|
696
741
|
expect(closedRequest.snapshot.agents).to.equal(undefined);
|
697
742
|
expect(closedRequest.closed_by).to.equal("user1");
|
698
743
|
|
699
|
-
|
744
|
+
requestService.closeRequestByRequestId(savedRequest.request_id, savedProject._id, false, true, "user1", true).then(function(closedRequest) {
|
745
|
+
expect(closedRequest.status).to.equal(1000);
|
746
|
+
done();
|
747
|
+
});
|
748
|
+
|
700
749
|
}).catch(function(err){
|
701
750
|
winston.error("test reject", err);
|
702
751
|
assert.isNotOk(err,'Promise error');
|
@@ -710,6 +759,8 @@ describe('RequestService', function () {
|
|
710
759
|
|
711
760
|
|
712
761
|
|
762
|
+
|
763
|
+
|
713
764
|
it('closeRequestAndSendTranscript', function (done) {
|
714
765
|
|
715
766
|
var email = "test-request-create-" + Date.now() + "@email.com";
|
@@ -0,0 +1,66 @@
|
|
1
|
+
var Project_user = require("../models/project_user");
|
2
|
+
var Group = require("../models/group");
|
3
|
+
var RoleConstants = require("../models/roleConstants");
|
4
|
+
|
5
|
+
|
6
|
+
class RecipientEmailUtil {
|
7
|
+
|
8
|
+
iterateProjectUser(project_users) {
|
9
|
+
let arr = [];
|
10
|
+
if (project_users && project_users.length>0) {
|
11
|
+
project_users.forEach(project_user => {
|
12
|
+
if (project_user.id_user && project_user.id_user.email) {
|
13
|
+
// tonew = tonew + project_user.id_user.email + ", ";
|
14
|
+
arr.push(project_user.id_user.email)
|
15
|
+
}
|
16
|
+
});
|
17
|
+
}
|
18
|
+
return arr;
|
19
|
+
}
|
20
|
+
|
21
|
+
async process(to, projectid) {
|
22
|
+
|
23
|
+
if (to.startsWith('@')) { //mention
|
24
|
+
// console.log("startsWith", to);
|
25
|
+
|
26
|
+
let project_users = await Project_user.find({ id_project: projectid, role: { $in : [RoleConstants.OWNER, RoleConstants.ADMIN]}, status: "active"} ).populate('id_user').exec();
|
27
|
+
|
28
|
+
let tonewArr = this.iterateProjectUser(project_users);
|
29
|
+
|
30
|
+
let tonew = tonewArr.toString();
|
31
|
+
// console.log("tonew mention", tonew);
|
32
|
+
return tonew;
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
}
|
37
|
+
if (to.indexOf('@')==-1) { //group
|
38
|
+
// console.log("indexOf-1", to);
|
39
|
+
let tonewArr = []
|
40
|
+
let group = await Group.findOne({name: to, id_project: projectid}).exec();
|
41
|
+
if (group) {
|
42
|
+
// console.log("group", group);
|
43
|
+
let project_users = await Project_user.find({ id_project: projectid, id_user: { $in : group.members}, role: { $in : [RoleConstants.OWNER, RoleConstants.ADMIN, RoleConstants.SUPERVISOR, RoleConstants.AGENT]}, status: "active" }).populate('id_user').exec();
|
44
|
+
// console.log("project_users", project_users);
|
45
|
+
tonewArr = this.iterateProjectUser(project_users);
|
46
|
+
}
|
47
|
+
let tonew = tonewArr.toString();
|
48
|
+
// console.log("tonew group", tonew);
|
49
|
+
return tonew;
|
50
|
+
|
51
|
+
}
|
52
|
+
// console.log("to.indexOf('@')",to.indexOf('@'));
|
53
|
+
if (to.indexOf('@')>0) { //standard email
|
54
|
+
// console.log("indexOf>0", to);
|
55
|
+
// console.log("tonew standard", to);
|
56
|
+
|
57
|
+
return to;
|
58
|
+
}
|
59
|
+
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
var recipientEmailUtil = new RecipientEmailUtil();
|
64
|
+
|
65
|
+
|
66
|
+
module.exports = recipientEmailUtil;
|