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: