support new format of confirmed mail

This commit is contained in:
2024-05-16 20:43:29 +02:00
parent ae6f8e53ab
commit 8aa3f364cb
+7 -1
View File
@@ -21,6 +21,8 @@ HERMES_EMAIL = "no-reply@hermes.com"
date_format = "%d-%b-%Y" # DD-Mon-YYYY e.g., 3-Mar-2014
FRENCH_CONFIRMED_MESSAGE = "Nous avons le plaisir de vous confirmer votre rendez-vous"
class MailConfirmationReader():
def __init__(self, login, password):
@@ -194,13 +196,17 @@ def find_confirmation_contacts_mail_list(mail_list):
for mail in mails_messages:
message_body = mail.body
for item in successful_items:
if item.id in message_body and item.id != "welcome" and len(item.id) > 0:
if item.id in message_body and item.id != "welcome" and len(item.id) > 0: # 如果邮件中包含有ID
item.message = message_body
accepted_appointment_list.append(item)
elif "10:30" in message_body and (
item.mail == mail.mail_address or item.mail in message_body) and len(item.id) > 0:
item.message = message_body
accepted_appointment_list.append(item)
elif FRENCH_CONFIRMED_MESSAGE in message_body and (
item.mail == mail.mail_address or item.mail in message_body) and len(item.id) > 0:
item.message = message_body
accepted_appointment_list.append(item)
elif "11:30" in message_body and (
item.mail == mail.mail_address or item.mail in message_body) and len(item.id) > 0:
item.message = message_body