Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -562,19 +562,19 @@ def answer_question(user_question, chatbot, audio=None):
|
|
| 562 |
match = re.search(email_pattern, user_question)
|
| 563 |
if match:
|
| 564 |
user_email = match.group() # Return the matched email
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
|
| 579 |
if "send email to" in user_question:
|
| 580 |
try:
|
|
|
|
| 562 |
match = re.search(email_pattern, user_question)
|
| 563 |
if match:
|
| 564 |
user_email = match.group() # Return the matched email
|
| 565 |
+
print("user_email")
|
| 566 |
+
print(user_email)
|
| 567 |
+
# email send
|
| 568 |
+
if user_email:
|
| 569 |
+
# Send email with the chart image attached
|
| 570 |
+
send_email_with_attachment(
|
| 571 |
+
recipient_email=user_email,
|
| 572 |
+
subject="Warehouse Inventory Report",
|
| 573 |
+
body=response.get("output", "").split(":")[0],
|
| 574 |
+
image_data = img_str
|
| 575 |
+
# attachment_path=chart_path
|
| 576 |
+
#attachment_path=os.getenv("IMAGE_PATH")
|
| 577 |
+
)
|
| 578 |
|
| 579 |
if "send email to" in user_question:
|
| 580 |
try:
|