WIP: don notification

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

View File

@ -85,19 +85,19 @@ def sendmail_with_attachment(headers, data, attachment_header, attachment, endin
subprocess.run([SENDMAIL_LOCATION, "-t", "-oi"], input=msg) subprocess.run([SENDMAIL_LOCATION, "-t", "-oi"], input=msg)
def notify_unpaid(donor): def notify_unpaid(record):
# Get infos # Get infos
name, surname, address, postal_code, city, email, amount, mode, truc = \ name, surname, address, postal_code, city, email, amount, mode, truc = \
get_file_content_all(WORKDIR+"/transition/"+donor).split("\n") get_file_content_all(WORKDIR+"/transition/"+record).split("\n")
pass pass
BUF.append("* {} {}, {}".format(numero, name, amount)) BUF.append("* {} {}, {}".format(record, name, amount))
BUF.append(" NOTIFICATION DONATEUR") BUF.append(" NOTIFICATION DONATEUR")
BUF.append("") BUF.append("")
mailtext = get_file_content_all(MODALITY_MAIL) + "\n" mailtext = get_file_content_all(MODALITY_MAIL) + "\n"
mailtext = mailtext.replace("NOM_DONNEUR", name) mailtext = mailtext.replace("NOM_DONNEUR", name)
mailtext = mailtext.replace("NUMERO_DON", str(numero)) mailtext = mailtext.replace("NUMERO_DON", str(record))
mailtext = mailtext.replace("MONTANT_DON", amount) mailtext = mailtext.replace("MONTANT_DON", amount)
mailtext = mailtext.replace("MODE_DON", year) mailtext = mailtext.replace("MODE_DON", year)
mailheaders = get_file_content_all(MODALITY_MAIL_HEADERS) + "\n" mailheaders = get_file_content_all(MODALITY_MAIL_HEADERS) + "\n"