create method go get not used contacts
This commit is contained in:
@@ -13,6 +13,7 @@ from src.db.mongo_manager import MONGO_STORE_MANAGER
|
|||||||
from src.logs.AppLogging import init_logger
|
from src.logs.AppLogging import init_logger
|
||||||
from src.mail.mail_constants import DOMAIN_HOTMAIL, create_imap
|
from src.mail.mail_constants import DOMAIN_HOTMAIL, create_imap
|
||||||
from src.pojo.mail.mail_pojo import MailPojo
|
from src.pojo.mail.mail_pojo import MailPojo
|
||||||
|
from src.utils import excel_reader
|
||||||
from src.utils.timeutiles import is_time_between
|
from src.utils.timeutiles import is_time_between
|
||||||
|
|
||||||
VALIDATION_URL_SUBJECT_fr = 'Validation de votre demande de rendez-vous'
|
VALIDATION_URL_SUBJECT_fr = 'Validation de votre demande de rendez-vous'
|
||||||
@@ -251,11 +252,12 @@ def need_to_check_email(mail: str, successful_items) -> bool:
|
|||||||
# return False
|
# return False
|
||||||
|
|
||||||
|
|
||||||
def read_all_mails():
|
def read_all_mails(contact_to_book_list=None):
|
||||||
# check time before start checking emails
|
# check time before start checking emails
|
||||||
if is_time_between(time(7, 30), time(19, 30)):
|
if is_time_between(time(7, 30), time(19, 30)):
|
||||||
# get email address
|
# get email address
|
||||||
contact_to_book_list = MONGO_STORE_MANAGER.get_all_contact_to_book_list()
|
if contact_to_book_list is None:
|
||||||
|
contact_to_book_list = MONGO_STORE_MANAGER.get_all_contact_to_book_list()
|
||||||
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||||
mail_list_to_check = []
|
mail_list_to_check = []
|
||||||
for contact in contact_to_book_list:
|
for contact in contact_to_book_list:
|
||||||
@@ -303,4 +305,7 @@ def read_all_mails():
|
|||||||
# check whether the url has already been clicked
|
# check whether the url has already been clicked
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
init_logger()
|
init_logger()
|
||||||
read_all_mails()
|
contact_to_book_list = excel_reader.read_contacts(
|
||||||
|
file_name="/Users/panlei/Desktop/contact_list_2024-06-28_4000.xlsx")
|
||||||
|
read_all_mails(contact_to_book_list=contact_to_book_list)
|
||||||
|
# read_all_mails()
|
||||||
|
|||||||
Reference in New Issue
Block a user