can send html format email

This commit is contained in:
2022-03-07 22:48:37 +01:00
parent c512dd65a3
commit a7afe54c13
13 changed files with 134 additions and 10 deletions
+4 -1
View File
@@ -4,6 +4,7 @@ from playwright.sync_api import sync_playwright
import params
from db.DbManager import DataManager
from logs.LogSender import EVENT_CHECK_RESULTS, LOG_SUBJECT_EVENT
from pojo.ReserveResultPojo import ReserveResultPojo
SORRY_SENTENCE = "nous sommes sincèrement désolés de n'avoir pu vous satisfaire cette fois-ci"
@@ -47,13 +48,15 @@ def run(playwright, url) -> ResultEnum:
# need to start at 21h00
if __name__ == '__main__':
# get the list
params.oracle_log_sender.send_log(msg="开始检查约会结果", subject=LOG_SUBJECT_EVENT, type=EVENT_CHECK_RESULTS)
db_manager = params.firebase_store_manager
collection = db_manager.get_all_successful_items()
count = 0
for appointment in collection.stream():
count = count + 1
reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict())
print("status is " + reserve_pojo.accepted)
if reserve_pojo.accepted:
print("status is " + reserve_pojo.accepted)
if reserve_pojo.accepted is None or ResultEnum.PENDING.value == reserve_pojo.accepted:
result = check_result_page(reserve_pojo.url)
collection.document(reserve_pojo.id).update({u'accepted': result.name})