correction on the mail sending

This commit is contained in:
2022-08-22 21:08:09 +02:00
parent 6d50091c56
commit 8dc0812fbb
+4 -3
View File
@@ -12,6 +12,7 @@ from src import params
from src.db.mongo_manager import MONGO_STORE_MANAGER from src.db.mongo_manager import MONGO_STORE_MANAGER
from src.notification.AcceptedResultPojo import get_accepted_result_from, AcceptedResultPojo from src.notification.AcceptedResultPojo import get_accepted_result_from, AcceptedResultPojo
from src.notification.mailer import Mailer from src.notification.mailer import Mailer
from src.pojo.ResultEnum import ResultEnum
from src.pojo.mail.mail_pojo import MailPojo, MailAddress from src.pojo.mail.mail_pojo import MailPojo, MailAddress
from src.proxy.proxy_type import ProxyType from src.proxy.proxy_type import ProxyType
from src.workers.link_validator import LinkValidator from src.workers.link_validator import LinkValidator
@@ -133,8 +134,8 @@ def need_to_valid_url(url: str, successful_items) -> bool:
def accept_appointment_found(accepted_result_list: list): def accept_appointment_found(accepted_result_list: list):
mailer = Mailer() mailer = Mailer()
for reserve in accepted_result_list: for reserve in accepted_result_list:
mailer.send_email(get_accepted_result_from(reserve), to_all=False) mailer.send_email(get_accepted_result_from(reserve), to_all=True)
MONGO_STORE_MANAGER.update_reserve_result(reserve.id, reserve.accepted) MONGO_STORE_MANAGER.update_reserve_result(reserve.id, ResultEnum.ACCEPTED)
def read_mails_and_find_confirmation_contacts(): def read_mails_and_find_confirmation_contacts():
@@ -155,7 +156,7 @@ def read_mails_and_find_confirmation_contacts():
for item in successful_items: for item in successful_items:
if item.id in message_body: if item.id in message_body:
accepted_appointment_list.append(item) accepted_appointment_list.append(item)
elif "10:30" in message_body and item.email in message_body: elif "10:30" in message_body and item.email == mail.mail_address:
accepted_appointment_list.append(item) accepted_appointment_list.append(item)
print(mail.mail_address) print(mail.mail_address)
print(mail.subject) print(mail.subject)