Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -559,7 +559,10 @@ def answer_question(user_question, chatbot, audio=None):
|
|
| 559 |
chatbot.append((user_question, img))
|
| 560 |
print("user_email")
|
| 561 |
print(user_email)
|
| 562 |
-
|
|
|
|
|
|
|
|
|
|
| 563 |
# email send
|
| 564 |
if user_email:
|
| 565 |
# Send email with the chart image attached
|
|
|
|
| 559 |
chatbot.append((user_question, img))
|
| 560 |
print("user_email")
|
| 561 |
print(user_email)
|
| 562 |
+
email_pattern = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
|
| 563 |
+
match = re.search(email_pattern, user_question)
|
| 564 |
+
if match:
|
| 565 |
+
user_email = match.group() # Return the matched email
|
| 566 |
# email send
|
| 567 |
if user_email:
|
| 568 |
# Send email with the chart image attached
|