@chat21/chat21-ionic 3.0.99 → 3.0.100

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
@@ -1,5 +1,8 @@
1
1
  # chat21-ionic ver 3.0
2
2
 
3
+ ### 3.0.100 in PROD
4
+ - bug-fixed: when offline email is sent, body message not send the last message on the conversation
5
+
3
6
  ### 3.0.99 in PROD
4
7
 
5
8
  ### 3.0.99-rc.2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chat21/chat21-ionic",
3
3
  "author": "Tiledesk SRL",
4
- "version": "3.0.99",
4
+ "version": "3.0.100",
5
5
  "license": "MIT License",
6
6
  "homepage": "https://tiledesk.com/",
7
7
  "repository": {
@@ -975,21 +975,27 @@ export class ConversationDetailPage implements OnInit, OnDestroy, AfterViewInit
975
975
  }
976
976
 
977
977
  createEmailText(lastMessageText: string): string {
978
- let text = ''
979
- this.messages.reverse().forEach((message, index) => {
978
+ let lastDate = new Date().toDateString();
979
+ let lastTime = new Date().getHours() + ':' + new Date().getMinutes() + ':' + new Date().getSeconds()
980
+ let text = 'On _' + lastDate + ' - ' + lastTime + '_ **' + this.loggedUser.fullname.trimEnd() + '**' + ' replied to you' + ': ' + '\n' +
981
+ lastMessageText + '\n\n\n'
982
+
983
+ //ADD CONVERSATION HISTORRY TO THE BODY OF THE EMAIL
984
+ let messages = JSON.parse(JSON.stringify(this.messages))
985
+ messages.reverse().forEach((message, index) => {
980
986
 
981
987
  let date = new Date(message.timestamp).toDateString()
982
988
  let time = new Date(message.timestamp).getHours() + ':' + new Date(message.timestamp).getMinutes() + ':' + new Date(message.timestamp).getSeconds()
983
989
  if (isInfo(message))
984
990
  return;
991
+ // if (index === 0)
992
+ // text += 'On _' + date + ' - ' + time + '_ **' + message.sender_fullname.trimEnd() + '**' + ' replied to you' + ': ' + '\n' +
993
+ // message.text + '\n\n\n'
985
994
  if (index === 0)
986
- text += 'On _' + date + ' - ' + time + '_ **' + message.sender_fullname.trimEnd() + '**' + ' replied to you' + ': ' + '\n' +
987
- message.text + '\n\n\n'
988
- if (index === 1)
989
995
  text += '_______________________________________________' + '\n' +
990
996
  '**' + 'CONVERSATION HISTORY:' + '**' + '\n' +
991
997
  '**' + message.sender_fullname.trimEnd() + '**' + ': ' + message.text + ' _(' + date + '-' + time + ')_' + '\n'
992
- if (index > 1)
998
+ if (index > 0)
993
999
  text += '**' + message.sender_fullname.trimEnd() + '**' + ': ' + message.text + ' _(' + date + '-' + time + ')_' + '\n'
994
1000
  })
995
1001