correction for mail read
This commit is contained in:
@@ -158,13 +158,19 @@ def accept_appointment_found(accepted_result_list: list):
|
|||||||
migre_accepted_appointment(str(datetime.date.today()))
|
migre_accepted_appointment(str(datetime.date.today()))
|
||||||
|
|
||||||
|
|
||||||
def read_mails_and_find_confirmation_contacts():
|
def find_confirmation_contacts_for_today():
|
||||||
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
_all_mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||||
# mail_list.reverse()
|
_all_appointments_today = MONGO_STORE_MANAGER.get_all_successful_items_for_day()
|
||||||
# excel_reader = ExcelHelper()
|
_mail_list_to_scan = []
|
||||||
# mail_list =excel_reader.read_email_pojo(file_name="/Users/lpan/Desktop/hotmail_list.xlsx")
|
for _item in _all_appointments_today:
|
||||||
# mail_address3 = MailAddress(mail="taibenchragu1978@onet.pl", password="2J)kyfNgyOZ")
|
for _mail in _all_mail_list:
|
||||||
# mail_list = [mail_address3]
|
if _mail.mail == _item.mail:
|
||||||
|
_mail_list_to_scan.append(_mail)
|
||||||
|
break
|
||||||
|
return _mail_list_to_scan
|
||||||
|
|
||||||
|
|
||||||
|
def find_confirmation_contacts_mail_list(mail_list):
|
||||||
mails_messages = []
|
mails_messages = []
|
||||||
# read all the emails
|
# read all the emails
|
||||||
with ThreadPoolExecutor(max_workers=200) as executor:
|
with ThreadPoolExecutor(max_workers=200) as executor:
|
||||||
@@ -187,11 +193,11 @@ def read_mails_and_find_confirmation_contacts():
|
|||||||
item.message = message_body
|
item.message = message_body
|
||||||
accepted_appointment_list.append(item)
|
accepted_appointment_list.append(item)
|
||||||
elif "10:30" in message_body and (
|
elif "10:30" in message_body and (
|
||||||
item.email == mail.mail_address or item.email in message_body) and len(item.id) > 0:
|
item.mail == mail.mail_address or item.mail in message_body) and len(item.id) > 0:
|
||||||
item.message = message_body
|
item.message = message_body
|
||||||
accepted_appointment_list.append(item)
|
accepted_appointment_list.append(item)
|
||||||
elif "11:30" in message_body and (
|
elif "11:30" in message_body and (
|
||||||
item.email == mail.mail_address or item.email in message_body) and len(item.id) > 0:
|
item.mail == mail.mail_address or item.mail in message_body) and len(item.id) > 0:
|
||||||
item.message = message_body
|
item.message = message_body
|
||||||
accepted_appointment_list.append(item)
|
accepted_appointment_list.append(item)
|
||||||
print(mail.mail_address)
|
print(mail.mail_address)
|
||||||
@@ -200,6 +206,19 @@ def read_mails_and_find_confirmation_contacts():
|
|||||||
accept_appointment_found(accepted_appointment_list)
|
accept_appointment_found(accepted_appointment_list)
|
||||||
|
|
||||||
|
|
||||||
|
def read_mails_and_find_confirmation_contacts():
|
||||||
|
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||||
|
find_confirmation_contacts_mail_list(mail_list)
|
||||||
|
# mail_list.reverse()
|
||||||
|
# excel_reader = ExcelHelper()
|
||||||
|
# mail_list =excel_reader.read_email_pojo(file_name="/Users/lpan/Desktop/hotmail_list.xlsx")
|
||||||
|
# mail_address3 = MailAddress(mail="taibenchragu1978@onet.pl", password="2J)kyfNgyOZ")
|
||||||
|
# mail_list = [mail_address3]
|
||||||
|
|
||||||
|
|
||||||
# check whether the url has already been clicked
|
# check whether the url has already been clicked
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
read_mails_and_find_confirmation_contacts()
|
# read_mails_and_find_confirmation_contacts()
|
||||||
|
_mail_list_today = find_confirmation_contacts_for_today()
|
||||||
|
# print("size is {}".format(len(_mail_list_today)))
|
||||||
|
find_confirmation_contacts_mail_list(_mail_list_today)
|
||||||
|
|||||||
Reference in New Issue
Block a user