WIP: don notification
This commit is contained in:
parent
81c1742b77
commit
eaaacf5462
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue