Omkar008 commited on
Commit
8364347
1 Parent(s): b0f69e6

Update controllers/ws_controller.py

Browse files
Files changed (1) hide show
  1. controllers/ws_controller.py +11 -1
controllers/ws_controller.py CHANGED
@@ -63,6 +63,16 @@ def fetch_message_data(access_token: str, message_id: str) -> Message:
63
  body = extract_body_from_mail(message_data)
64
 
65
  attachments = extract_attachments_from_mail(access_token, message_data)
 
 
 
 
 
 
 
 
 
 
66
  # print("subject: ")
67
  # print(subject)
68
  # print("company name: ")
@@ -72,7 +82,7 @@ def fetch_message_data(access_token: str, message_id: str) -> Message:
72
  # print("Printing attachment Data: ")
73
  # print(attachments)
74
  # print("Completed this mail.")
75
- return Message(message_id=message_id, body=body, attachments=attachments, company=company_from_mail)
76
 
77
 
78
  def extract_subject_from_mail(message_data: dict) -> str:
 
63
  body = extract_body_from_mail(message_data)
64
 
65
  attachments = extract_attachments_from_mail(access_token, message_data)
66
+ body_len = 0
67
+ attachments_len = 0
68
+ if body is not None :
69
+ body_len = len(body)
70
+
71
+ if attachments is not None:
72
+ attachments_len = len(attachments)
73
+
74
+
75
+
76
  # print("subject: ")
77
  # print(subject)
78
  # print("company name: ")
 
82
  # print("Printing attachment Data: ")
83
  # print(attachments)
84
  # print("Completed this mail.")
85
+ return Message(message_id=message_id, body=body, attachments=attachments, company=company_from_mail , body_len , attachments_len)
86
 
87
 
88
  def extract_subject_from_mail(message_data: dict) -> str: