send confirmation info by signal
This commit is contained in:
Regular → Executable
+4
-9
@@ -13,12 +13,6 @@ class MailAddressValidator():
|
||||
self.login = login
|
||||
self.password = password
|
||||
|
||||
@staticmethod
|
||||
def show_folders(imap):
|
||||
for i in imap.list()[1]:
|
||||
l = i.decode().split(' "/" ')
|
||||
print(l[0] + " = " + l[1])
|
||||
|
||||
def is_valid_email_address(self) -> bool:
|
||||
# authenticate
|
||||
imap = create_imap(self.login)
|
||||
@@ -66,9 +60,10 @@ def find_and_update_invalid_emails(mail_list):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# remove_invalid_email()
|
||||
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||
remove_invalid_email()
|
||||
|
||||
# mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||
# excel_reader = ExcelHelper()
|
||||
# mail_list = excel_reader.read_mails_and_pwd(file_name="/Users/lpan/Downloads/hotmail_list.xlsx")
|
||||
# print(email_list)
|
||||
find_and_update_invalid_emails(mail_list)
|
||||
# find_and_update_invalid_emails(mail_list)
|
||||
|
||||
Regular → Executable
+9
-4
@@ -11,13 +11,14 @@ from src.db.mirgration.migration_tools import migre_accepted_appointment
|
||||
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
||||
from src.mail.mail_constants import create_imap, show_folders
|
||||
from src.notification.AcceptedResultPojo import get_accepted_result_from
|
||||
from src.notification.SignalSender import SignalSender
|
||||
from src.notification.mailer import Mailer
|
||||
from src.pojo.ResultEnum import ResultEnum
|
||||
from src.pojo.mail.mail_pojo import MailPojo
|
||||
from src.pojo.mail.mail_pojo import MailPojo, MailAddress
|
||||
from src.utils.excel_reader import ExcelHelper
|
||||
|
||||
CONFIRMATION_SUBJECT_FR = 'Votre rendez-vous est'
|
||||
CONFIRMATION_SUBJECT_EN = 'appointment is confirmed'
|
||||
CONFIRMATION_SUBJECT_FR = 'rendez-vous est'
|
||||
CONFIRMATION_SUBJECT_EN = 'confirmed'
|
||||
HERMES_EMAIL = "no-reply@hermes.com"
|
||||
|
||||
date_format = "%d-%b-%Y" # DD-Mon-YYYY e.g., 3-Mar-2014
|
||||
@@ -145,10 +146,13 @@ def clean(text):
|
||||
|
||||
def accept_appointment_found(accepted_result_list: list):
|
||||
mailer = Mailer()
|
||||
sginal = SignalSender()
|
||||
print(accepted_result_list)
|
||||
for reserve in accepted_result_list:
|
||||
mailer.send_email(get_accepted_result_from(reserve, MONGO_STORE_MANAGER), to_all=True)
|
||||
result = get_accepted_result_from(reserve, MONGO_STORE_MANAGER)
|
||||
mailer.send_email(result, to_all=False)
|
||||
MONGO_STORE_MANAGER.update_reserve_result(reserve.id, ResultEnum.ACCEPTED, reserve.message)
|
||||
sginal.send_result(result)
|
||||
|
||||
if len(accepted_result_list) > 0:
|
||||
migre_accepted_appointment(str(datetime.date.today()))
|
||||
@@ -156,6 +160,7 @@ def accept_appointment_found(accepted_result_list: list):
|
||||
|
||||
def read_mails_and_find_confirmation_contacts():
|
||||
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user