Redmind commited on
Commit
529bb03
·
verified ·
1 Parent(s): bedd024

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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