@chat21/chat21-ionic 3.0.96 → 3.0.97-rc.1
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
package/package.json
CHANGED
|
@@ -940,18 +940,26 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
940
940
|
|
|
941
941
|
}
|
|
942
942
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
943
|
+
createEmailText(lastMessageText: string): string{
|
|
944
|
+
let text = ''
|
|
945
|
+
this.messages.reverse().forEach((message, index) => {
|
|
946
|
+
|
|
947
|
+
let date = new Date(message.timestamp).toDateString()
|
|
948
|
+
let time = new Date(message.timestamp).getHours() + ':'+ new Date(message.timestamp).getMinutes() + ':' + new Date(message.timestamp).getSeconds()
|
|
949
|
+
if(isInfo(message))
|
|
950
|
+
return;
|
|
951
|
+
if(index === 0)
|
|
952
|
+
text += 'On _' + date + ' - ' + time + '_ **' + message.sender_fullname + '**' + ' replied to you' + ': ' + '\n' +
|
|
953
|
+
message.text + '\n\n\n'
|
|
954
|
+
if(index === 1)
|
|
955
|
+
text += '_______________________________________________' + '\n' +
|
|
956
|
+
'**' + 'CONVERSATION HISTORY:'+ '**' + '\n' +
|
|
957
|
+
'**' + message.sender_fullname + '**' + ': ' + message.text +' _('+ date + '-' + time +')_' + '\n'
|
|
958
|
+
if(index > 1)
|
|
959
|
+
text += '**' + message.sender_fullname + '**' + ': ' + message.text +' _('+ date + '-' + time +')_' + '\n'
|
|
960
|
+
})
|
|
961
|
+
return text
|
|
962
|
+
}
|
|
955
963
|
|
|
956
964
|
sendEmail(message: string): Observable<boolean>{
|
|
957
965
|
const tiledeskToken= this.tiledeskAuthService.getTiledeskToken();
|
|
@@ -1051,9 +1059,8 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
|
|
|
1051
1059
|
this.leadInfo && this.leadInfo.presence && this.leadInfo.presence['status']=== 'offline' &&
|
|
1052
1060
|
this.leadInfo.email && !emailSectionMsg){
|
|
1053
1061
|
this.logger.log('[CONVS-DETAIL] - SEND MESSAGE --> SENDING EMAIL', msg, this.leadInfo.email)
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
this.sendEmail(msg).subscribe(status => {
|
|
1062
|
+
let msgText = this.createEmailText(msg)
|
|
1063
|
+
this.sendEmail(msgText).subscribe(status => {
|
|
1057
1064
|
if(status){
|
|
1058
1065
|
//SEND MESSAGE ALSO AS EMAIL
|
|
1059
1066
|
attributes['channel']= 'offline_'+TYPE_MSG_EMAIL
|