AIEmailAutomationUtility 0.0.27__py3-none-any.whl → 0.0.28__py3-none-any.whl

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.
@@ -105,47 +105,51 @@ class Process_Category:
105
105
  logger.log(f"fileName 107::: {fileName}")
106
106
  logger.log(f"document_type 108::: {document_type}")
107
107
 
108
- if responseMethod == "Upload_Document":
109
- # Get today's date folder path
110
- today_date = datetime.today().strftime('%Y-%m-%d')
111
- order_folder = os.path.join(document_type, today_date)
112
-
113
- email_upload_document = Email_DocumentUploader()
114
- if len(fileName) != 0:
115
- file_path = os.path.join(order_folder, fileName) # Correct file path
116
-
117
- with open(file_path, "rb") as file:
118
- parameters["DOCUMENT_TYPE"] = document_type
119
-
120
- logger.log(f"Updated Parameters ::: {parameters}")
121
- response_status, restAPI_Result = email_upload_document.email_document_upload(file, parameters)
122
- logger.log(f"email_upload_document_response ::: {restAPI_Result}")
123
- else:
124
- document_type = "Order Email"
108
+ if document_type != '':
109
+ if responseMethod == "Upload_Document":
125
110
  # Get today's date folder path
126
111
  today_date = datetime.today().strftime('%Y-%m-%d')
127
112
  order_folder = os.path.join(document_type, today_date)
128
113
 
129
- parameters["DOCUMENT_TYPE"] = document_type
130
- logger.log(f"Updated Parameters ::: {parameters}")
131
- new_fileName = self.create_file_from_emailBody(email_body, sender_email_addr, parameters)
132
- new_file_path = os.path.join(order_folder, new_fileName)
133
-
134
- with open(new_file_path, "rb") as file:
135
- response_status, restAPI_Result = email_upload_document.email_document_upload(file, parameters)
136
- logger.log(f"email_upload_document_response ::: {restAPI_Result}")
137
-
138
- if response_status == "200":
139
- logger.log(f"Attachment uploaded successfully against Document ID: '{restAPI_Result}'.")
140
- csv_data_status="Success",
141
- csv_data_response=f"Attachment uploaded successfully against Document ID: '{restAPI_Result}'"
114
+ email_upload_document = Email_DocumentUploader()
115
+ if len(fileName) != 0:
116
+ file_path = os.path.join(order_folder, fileName) # Correct file path
117
+
118
+ with open(file_path, "rb") as file:
119
+ parameters["DOCUMENT_TYPE"] = document_type
120
+
121
+ logger.log(f"Updated Parameters ::: {parameters}")
122
+ response_status, restAPI_Result = email_upload_document.email_document_upload(file, parameters)
123
+ logger.log(f"email_upload_document_response ::: {restAPI_Result}")
124
+ else:
125
+ document_type = "Order Email"
126
+ # Get today's date folder path
127
+ today_date = datetime.today().strftime('%Y-%m-%d')
128
+ order_folder = os.path.join(document_type, today_date)
129
+
130
+ parameters["DOCUMENT_TYPE"] = document_type
131
+ logger.log(f"Updated Parameters ::: {parameters}")
132
+ new_fileName = self.create_file_from_emailBody(email_body, sender_email_addr, parameters)
133
+ new_file_path = os.path.join(order_folder, new_fileName)
134
+
135
+ with open(new_file_path, "rb") as file:
136
+ response_status, restAPI_Result = email_upload_document.email_document_upload(file, parameters)
137
+ logger.log(f"email_upload_document_response ::: {restAPI_Result}")
138
+
139
+ if response_status == "200":
140
+ logger.log(f"Attachment uploaded successfully against Document ID: '{restAPI_Result}'.")
141
+ csv_data_status="Success",
142
+ csv_data_response=f"Attachment uploaded successfully against Document ID: '{restAPI_Result}'"
143
+ else:
144
+ logger.log(restAPI_Result)
145
+ csv_data_status="Fail",
146
+ csv_data_response=f"Attachment uploaded Failed against Document ID: '{restAPI_Result}'"
142
147
  else:
143
- logger.log(restAPI_Result)
144
- csv_data_status="Fail",
145
- csv_data_response=f"Attachment uploaded Failed against Document ID: '{restAPI_Result}'"
148
+ message = f"Invalid response method received '{responseMethod}' for category : '{category}'"
149
+ raise ValueError(message)
146
150
  else:
147
- message = f"Invalid response method received '{responseMethod}' for category : '{category}'"
148
- raise ValueError(message)
151
+ csv_data_status="Fail",
152
+ csv_data_response=f"Respective document type has not matched for uploading."
149
153
 
150
154
  elif category == "Quotation":
151
155
  action_taken = f"Mail drafted for products rate"
@@ -398,7 +402,7 @@ class Process_Category:
398
402
 
399
403
  filename = ""
400
404
  mime_type = ""
401
- document_type = "Orders"
405
+ document_type = ""
402
406
 
403
407
  for part in msg.walk():
404
408
  if part.get_content_maintype() == 'multipart':
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: AIEmailAutomationUtility
3
- Version: 0.0.27
4
- Summary: Added 3 more parameters in the right panel of quotation email utilty
3
+ Version: 0.0.28
4
+ Summary: Set Bydefault document type as blank to avoid garbage data while uploading
5
5
  Author: Proteus Technology PVT. LTD.
6
6
  Author-email: <apps@baseinformation.com>
7
7
  Keywords: python,first package
@@ -13,4 +13,4 @@ Classifier: Operating System :: MacOS :: MacOS X
13
13
  Classifier: Operating System :: Microsoft :: Windows
14
14
  License-File: LICENCE.txt
15
15
 
16
- Added 3 more parameters in the right panel of quotation email utilty
16
+ Set Bydefault document type as blank to avoid garbage data while uploading
@@ -4,12 +4,12 @@ AIEmailAutomationUtility/Email_DocumentUploader.py,sha256=YJu4tuTHr0K-5vuds9gZfj
4
4
  AIEmailAutomationUtility/Email_Draft.py,sha256=DcyBeDaE8CReKHnHxLiz-o2tDxuUgwy91c4k0qhQbVw,7749
5
5
  AIEmailAutomationUtility/Email_Read.py,sha256=pRqc9295r_qqdfWIFJFG2XH9J-VlvO1E0yP3iv_cRV4,27802
6
6
  AIEmailAutomationUtility/Email_Upload_Document.py,sha256=3bdkxfDlwoeRp-46KPw2Gs1dqBhEIoA1yE5GCudpdV8,1320
7
- AIEmailAutomationUtility/Process_Category.py,sha256=4Zrc1RaKMCK5oPYo1NfsBp1ba1G-6kMIsV0P3TLATwc,43771
7
+ AIEmailAutomationUtility/Process_Category.py,sha256=f17YF8rfSTFScxBfAhuJJ8ev6TbxYDcPQljIpZWa5PY,44100
8
8
  AIEmailAutomationUtility/Save_Draft.py,sha256=yzLgFN14I_lXE6qL0I3tKNduvcnWdbsY9i2mKdTtio4,5348
9
9
  AIEmailAutomationUtility/Save_Transaction.py,sha256=Gg1w6hhzHmEFjsuzYvkq-3-EsWReetjLHsYSv5YIGgM,3816
10
10
  AIEmailAutomationUtility/__init__.py,sha256=Jad3IdPRsVMeLqEEh-FbCrc1lE2tzJO2DTG5Hgmxh5g,391
11
- AIEmailAutomationUtility-0.0.27.dist-info/LICENCE.txt,sha256=2qX9IkEUBx0VJp1Vh9O2dsRwE-IpYId0lXDyn7OVsJ8,1073
12
- AIEmailAutomationUtility-0.0.27.dist-info/METADATA,sha256=J9vR4Pa5JSL6iAWD1yZeEYBcgTGDzMimpejMr8gLKw4,637
13
- AIEmailAutomationUtility-0.0.27.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
14
- AIEmailAutomationUtility-0.0.27.dist-info/top_level.txt,sha256=3jTWrTUblVkaP7mpwY2UBSnrlfot5Ykpfsehyke-Uzw,25
15
- AIEmailAutomationUtility-0.0.27.dist-info/RECORD,,
11
+ AIEmailAutomationUtility-0.0.28.dist-info/LICENCE.txt,sha256=2qX9IkEUBx0VJp1Vh9O2dsRwE-IpYId0lXDyn7OVsJ8,1073
12
+ AIEmailAutomationUtility-0.0.28.dist-info/METADATA,sha256=u5RJjpiERsP60tsBgtLops76gMlO2yuRq9naJ-_5Qmo,649
13
+ AIEmailAutomationUtility-0.0.28.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
14
+ AIEmailAutomationUtility-0.0.28.dist-info/top_level.txt,sha256=3jTWrTUblVkaP7mpwY2UBSnrlfot5Ykpfsehyke-Uzw,25
15
+ AIEmailAutomationUtility-0.0.28.dist-info/RECORD,,