From 7dc37931dc395ab25e58bfdd007148b8e5ca82a7 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sun, 9 Oct 2022 01:17:01 +0200 Subject: [PATCH] WIP: don notification --- controle_don/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controle_don/main.py b/controle_don/main.py index 4c4baba..5a3dae0 100755 --- a/controle_don/main.py +++ b/controle_don/main.py @@ -86,12 +86,12 @@ def sendmail_with_attachment(headers, data, attachment_header, attachment, endin subprocess.run([SENDMAIL_LOCATION, "-t", "-oi"], input=msg) def notify_unpaid(record): - # Get infos - + # Check if notified content = get_file_content_all(WORKDIR+"/transition/"+record).split("\n") if len(content) > 8 and "notified" in content[8]: return + # Get infos name, surname, address, postal_code, city, email, amount, mode = \ get_file_content_all(WORKDIR+"/transition/"+record).split("\n")[:8] @@ -107,8 +107,8 @@ def notify_unpaid(record): mailheaders = get_file_content_all(MODALITY_MAIL_HEADERS) + "\n" mailheaders = mailheaders.replace("COURRIEL_DONNEUR", email) - print(mailtext) - #sendmail(mailheaders, mailtext) + # Notify + sendmail(mailheaders, mailtext) # Indicate as notified with open(WORKDIR+"/transition/"+record, "a") as sfile: