correction on the mail sending
This commit is contained in:
@@ -12,6 +12,7 @@ from src import params
|
||||
from src.db.mongo_manager import MONGO_STORE_MANAGER
|
||||
from src.notification.AcceptedResultPojo import get_accepted_result_from, AcceptedResultPojo
|
||||
from src.notification.mailer import Mailer
|
||||
from src.pojo.ResultEnum import ResultEnum
|
||||
from src.pojo.mail.mail_pojo import MailPojo, MailAddress
|
||||
from src.proxy.proxy_type import ProxyType
|
||||
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):
|
||||
mailer = Mailer()
|
||||
for reserve in accepted_result_list:
|
||||
mailer.send_email(get_accepted_result_from(reserve), to_all=False)
|
||||
MONGO_STORE_MANAGER.update_reserve_result(reserve.id, reserve.accepted)
|
||||
mailer.send_email(get_accepted_result_from(reserve), to_all=True)
|
||||
MONGO_STORE_MANAGER.update_reserve_result(reserve.id, ResultEnum.ACCEPTED)
|
||||
|
||||
|
||||
def read_mails_and_find_confirmation_contacts():
|
||||
@@ -155,7 +156,7 @@ def read_mails_and_find_confirmation_contacts():
|
||||
for item in successful_items:
|
||||
if item.id in message_body:
|
||||
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)
|
||||
print(mail.mail_address)
|
||||
print(mail.subject)
|
||||
|
||||
Reference in New Issue
Block a user