WIP: don notification

This commit is contained in:
Adrien Bourmault 2022-10-09 00:30:06 +02:00
parent 81c1742b77
commit eaaacf5462
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 5 additions and 2 deletions

View File

@ -87,6 +87,8 @@ def sendmail_with_attachment(headers, data, attachment_header, attachment, endin
def notify_unpaid(donor): def notify_unpaid(donor):
# Get infos # Get infos
name, surname, address, postal_code, city, email, amount, mode, truc = \
get_file_content_all(WORKDIR+"/transition/"+donor).split("\n")
pass pass
BUF.append("* {} {}, {}".format(numero, name, amount)) BUF.append("* {} {}, {}".format(numero, name, amount))
@ -101,7 +103,8 @@ def notify_unpaid(donor):
mailheaders = get_file_content_all(MODALITY_MAIL_HEADERS) + "\n" mailheaders = get_file_content_all(MODALITY_MAIL_HEADERS) + "\n"
mailheaders = mailheaders.replace("COURRIEL_DONNEUR", email) mailheaders = mailheaders.replace("COURRIEL_DONNEUR", email)
sendmail(mailheaders, mailtext) print(mailtext)
#sendmail(mailheaders, mailtext)
def validate(record): def validate(record):
@ -207,7 +210,7 @@ def validate_donors():
# Validate record # Validate record
for record in os.listdir(WORKDIR+"/transition"): for record in os.listdir(WORKDIR+"/transition"):
if not validate(record): if not validate(record):
print("Ouais faut notifier") notify_unpaid(record)
def main(): def main():
setup_workdir() setup_workdir()